新增:安全技术数据
This commit is contained in:
@@ -0,0 +1,443 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// PDF 书籍模块 WebAPI 数据服务(移动端 / 第三方系统集成用)。
|
||||
/// 对应 PC 页面 HSSE/PDFDOC/PdfBookView.aspx 的完整功能:书籍、多级章节目录、章节正文(富文本 HTML)的
|
||||
/// 查询与维护(新增书籍 / 新增·编辑·删除章节 / 保存章节正文),并额外提供章节关键词检索。
|
||||
/// 数据表:Sys_PdfBook / Sys_PdfChapter(正文存 [Text] 列,为 UMeditor 生成的 HTML)。
|
||||
/// 说明:目录结构用 ParentChapterId + Level(1章 2节 3小节) 表达多级层级,SortNo 控制同级顺序。
|
||||
/// </summary>
|
||||
public static class APIPdfBookService
|
||||
{
|
||||
#region 返回模型
|
||||
/// <summary>书籍列表项。</summary>
|
||||
public class BookItem
|
||||
{
|
||||
/// <summary>书籍主键。</summary>
|
||||
public string BookId { get; set; }
|
||||
/// <summary>书名。</summary>
|
||||
public string Title { get; set; }
|
||||
/// <summary>章节总数。</summary>
|
||||
public int ChapterCount { get; set; }
|
||||
/// <summary>登记时间。</summary>
|
||||
public DateTime? CreateTime { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>章节目录树节点(多级嵌套)。</summary>
|
||||
public class ChapterTreeNode
|
||||
{
|
||||
/// <summary>章节主键。</summary>
|
||||
public string ChapterId { get; set; }
|
||||
/// <summary>章节名称。</summary>
|
||||
public string ChapterTitle { get; set; }
|
||||
/// <summary>层级:1章 2节 3小节。</summary>
|
||||
public int Level { get; set; }
|
||||
/// <summary>起始页码(无则为0)。</summary>
|
||||
public int PageStart { get; set; }
|
||||
/// <summary>结束页码(无则为0)。</summary>
|
||||
public int PageEnd { get; set; }
|
||||
/// <summary>是否已有正文内容(用于客户端标识可读章节)。</summary>
|
||||
public bool HasContent { get; set; }
|
||||
/// <summary>子章节列表(叶子章节为空数组)。</summary>
|
||||
public List<ChapterTreeNode> Children { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>章节正文详情。</summary>
|
||||
public class ChapterDetailItem
|
||||
{
|
||||
/// <summary>章节主键。</summary>
|
||||
public string ChapterId { get; set; }
|
||||
/// <summary>所属书籍主键。</summary>
|
||||
public string BookId { get; set; }
|
||||
/// <summary>所属书籍名称。</summary>
|
||||
public string BookTitle { get; set; }
|
||||
/// <summary>章节名称。</summary>
|
||||
public string ChapterTitle { get; set; }
|
||||
/// <summary>父章节主键(顶级为 null)。</summary>
|
||||
public string ParentChapterId { get; set; }
|
||||
/// <summary>层级:1章 2节 3小节。</summary>
|
||||
public int Level { get; set; }
|
||||
/// <summary>起始页码(无则为0)。</summary>
|
||||
public int PageStart { get; set; }
|
||||
/// <summary>结束页码(无则为0)。</summary>
|
||||
public int PageEnd { get; set; }
|
||||
/// <summary>正文(富文本 HTML,可直接用 WebView 渲染)。</summary>
|
||||
public string Content { get; set; }
|
||||
/// <summary>正文纯文本(去掉 HTML 标签,便于全文展示/搜索)。</summary>
|
||||
public string ContentText { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>章节关键词检索命中项。</summary>
|
||||
public class SearchHitItem
|
||||
{
|
||||
/// <summary>书籍主键。</summary>
|
||||
public string BookId { get; set; }
|
||||
/// <summary>书籍名称。</summary>
|
||||
public string BookTitle { get; set; }
|
||||
/// <summary>章节主键。</summary>
|
||||
public string ChapterId { get; set; }
|
||||
/// <summary>章节名称。</summary>
|
||||
public string ChapterTitle { get; set; }
|
||||
/// <summary>起始页码(无则为0)。</summary>
|
||||
public int PageStart { get; set; }
|
||||
/// <summary>结束页码(无则为0)。</summary>
|
||||
public int PageEnd { get; set; }
|
||||
/// <summary>命中片段(关键词前后各约40字)。</summary>
|
||||
public string Snippet { get; set; }
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 查询:书籍列表
|
||||
/// <summary>
|
||||
/// 获取全部书籍(按登记时间升序,与页面下拉一致)。
|
||||
/// </summary>
|
||||
public static List<BookItem> GetBooks()
|
||||
{
|
||||
var list = new List<BookItem>();
|
||||
DataTable dt = SQLHelper.GetDataTableRunText(
|
||||
"SELECT b.BookId, b.Title, b.CreateTime, " +
|
||||
"(SELECT COUNT(*) FROM dbo.Sys_PdfChapter c WHERE c.BookId = b.BookId) AS ChapterCount " +
|
||||
"FROM dbo.Sys_PdfBook b ORDER BY b.CreateTime", new SqlParameter[] { });
|
||||
if (dt == null)
|
||||
return list;
|
||||
foreach (DataRow r in dt.Rows)
|
||||
{
|
||||
list.Add(new BookItem
|
||||
{
|
||||
BookId = r["BookId"] == null ? "" : r["BookId"].ToString(),
|
||||
Title = r["Title"] == null ? "" : r["Title"].ToString(),
|
||||
ChapterCount = r["ChapterCount"] == DBNull.Value ? 0 : Convert.ToInt32(r["ChapterCount"]),
|
||||
CreateTime = r["CreateTime"] == DBNull.Value ? (DateTime?)null : Convert.ToDateTime(r["CreateTime"])
|
||||
});
|
||||
}
|
||||
return list;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 查询:多级章节目录树
|
||||
/// <summary>
|
||||
/// 获取某本书的多级章节目录树(嵌套 Children,顶级为根的数组;按 SortNo 排序)。
|
||||
/// </summary>
|
||||
public static List<ChapterTreeNode> GetChapterTree(string bookId)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(bookId))
|
||||
throw new Exception("bookId 不能为空");
|
||||
|
||||
var chapters = PdfBookService.GetChapters(bookId);
|
||||
var result = new List<ChapterTreeNode>();
|
||||
if (chapters == null || chapters.Count == 0)
|
||||
return result;
|
||||
|
||||
// 有正文标记(一次查询)
|
||||
var hasContentSet = new HashSet<string>();
|
||||
DataTable dt = SQLHelper.GetDataTableRunText(
|
||||
"SELECT ChapterId FROM dbo.Sys_PdfChapter " +
|
||||
"WHERE BookId = @BookId AND [Text] IS NOT NULL AND LTRIM(RTRIM([Text])) <> N''",
|
||||
new[] { new SqlParameter("@BookId", bookId) });
|
||||
if (dt != null)
|
||||
foreach (DataRow r in dt.Rows)
|
||||
hasContentSet.Add(r["ChapterId"] == null ? "" : r["ChapterId"].ToString());
|
||||
|
||||
// 1) 先为每个章节建节点
|
||||
var nodeMap = new Dictionary<string, ChapterTreeNode>();
|
||||
foreach (PdfChapter c in chapters)
|
||||
{
|
||||
nodeMap[c.ChapterId] = new ChapterTreeNode
|
||||
{
|
||||
ChapterId = c.ChapterId,
|
||||
ChapterTitle = c.Title,
|
||||
Level = c.Level,
|
||||
PageStart = c.PageStart,
|
||||
PageEnd = c.PageEnd,
|
||||
HasContent = hasContentSet.Contains(c.ChapterId),
|
||||
Children = new List<ChapterTreeNode>()
|
||||
};
|
||||
}
|
||||
|
||||
// 2) 按父章节挂接(父不在列表中的作为顶级)
|
||||
foreach (PdfChapter c in chapters)
|
||||
{
|
||||
var node = nodeMap[c.ChapterId];
|
||||
if (!string.IsNullOrWhiteSpace(c.ParentChapterId) && nodeMap.ContainsKey(c.ParentChapterId))
|
||||
nodeMap[c.ParentChapterId].Children.Add(node);
|
||||
else
|
||||
result.Add(node);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 查询:章节正文
|
||||
/// <summary>
|
||||
/// 获取章节正文详情(含 HTML 与纯文本);章节不存在返回 null。
|
||||
/// </summary>
|
||||
public static ChapterDetailItem GetChapterDetail(string chapterId)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(chapterId))
|
||||
throw new Exception("chapterId 不能为空");
|
||||
|
||||
DataTable dt = SQLHelper.GetDataTableRunText(
|
||||
"SELECT c.ChapterId, c.BookId, b.Title AS BookTitle, c.ParentChapterId, c.[Level], " +
|
||||
"c.ChapterTitle, c.PageStart, c.PageEnd, c.[Text] " +
|
||||
"FROM dbo.Sys_PdfChapter c INNER JOIN dbo.Sys_PdfBook b ON c.BookId = b.BookId " +
|
||||
"WHERE c.ChapterId = @ChapterId",
|
||||
new[] { new SqlParameter("@ChapterId", chapterId) });
|
||||
if (dt == null || dt.Rows.Count == 0)
|
||||
return null;
|
||||
|
||||
DataRow r = dt.Rows[0];
|
||||
string html = r["Text"] == DBNull.Value ? "" : r["Text"].ToString();
|
||||
var item = new ChapterDetailItem
|
||||
{
|
||||
ChapterId = r["ChapterId"] == null ? "" : r["ChapterId"].ToString(),
|
||||
BookId = r["BookId"] == null ? "" : r["BookId"].ToString(),
|
||||
BookTitle = r["BookTitle"] == null ? "" : r["BookTitle"].ToString(),
|
||||
ParentChapterId = r["ParentChapterId"] == DBNull.Value ? null : r["ParentChapterId"].ToString(),
|
||||
Level = r["Level"] == DBNull.Value ? 1 : Convert.ToInt32(r["Level"]),
|
||||
ChapterTitle = r["ChapterTitle"] == null ? "" : r["ChapterTitle"].ToString(),
|
||||
PageStart = r["PageStart"] == DBNull.Value ? 0 : Convert.ToInt32(r["PageStart"]),
|
||||
PageEnd = r["PageEnd"] == DBNull.Value ? 0 : Convert.ToInt32(r["PageEnd"]),
|
||||
Content = html,
|
||||
ContentText = HtmlToPlainText(html)
|
||||
};
|
||||
return item;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 查询:章节关键词检索
|
||||
/// <summary>
|
||||
/// 章节关键词检索:在章节正文中按关键词做字面匹配(正文为 HTML,匹配前先剔除标签)。
|
||||
/// bookId 可空:不传则全库检索。
|
||||
/// </summary>
|
||||
public static List<SearchHitItem> SearchChapter(string keyword, string bookId)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(keyword))
|
||||
throw new Exception("keyword 不能为空");
|
||||
|
||||
// LIKE 通配符转义(ESCAPE 字符为反斜杠)
|
||||
string esc = keyword.Replace("\\", "\\\\").Replace("%", "\\%").Replace("_", "\\_");
|
||||
var ps = new List<SqlParameter>
|
||||
{
|
||||
new SqlParameter("@Keyword", "%" + esc + "%")
|
||||
};
|
||||
string where = "c.[Text] LIKE @Keyword ESCAPE '\\'";
|
||||
if (!string.IsNullOrWhiteSpace(bookId))
|
||||
{
|
||||
where += " AND c.BookId = @BookId";
|
||||
ps.Add(new SqlParameter("@BookId", bookId));
|
||||
}
|
||||
|
||||
DataTable dt = SQLHelper.GetDataTableRunText(
|
||||
"SELECT c.ChapterId, c.ChapterTitle, c.BookId, b.Title AS BookTitle, " +
|
||||
"c.PageStart, c.PageEnd, c.[Text] " +
|
||||
"FROM dbo.Sys_PdfChapter c INNER JOIN dbo.Sys_PdfBook b ON c.BookId = b.BookId " +
|
||||
"WHERE " + where + " ORDER BY b.Title, c.SortNo", ps.ToArray());
|
||||
|
||||
var list = new List<SearchHitItem>();
|
||||
if (dt == null)
|
||||
return list;
|
||||
foreach (DataRow r in dt.Rows)
|
||||
{
|
||||
string html = r["Text"] == DBNull.Value ? "" : r["Text"].ToString();
|
||||
string plain = HtmlToPlainText(html);
|
||||
list.Add(new SearchHitItem
|
||||
{
|
||||
BookId = r["BookId"] == null ? "" : r["BookId"].ToString(),
|
||||
BookTitle = r["BookTitle"] == null ? "" : r["BookTitle"].ToString(),
|
||||
ChapterId = r["ChapterId"] == null ? "" : r["ChapterId"].ToString(),
|
||||
ChapterTitle = r["ChapterTitle"] == null ? "" : r["ChapterTitle"].ToString(),
|
||||
PageStart = r["PageStart"] == DBNull.Value ? 0 : Convert.ToInt32(r["PageStart"]),
|
||||
PageEnd = r["PageEnd"] == DBNull.Value ? 0 : Convert.ToInt32(r["PageEnd"]),
|
||||
Snippet = BuildSnippet(plain, keyword)
|
||||
});
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/// <summary>取关键词命中片段(前后各约40字)。</summary>
|
||||
private static string BuildSnippet(string plain, string keyword)
|
||||
{
|
||||
if (string.IsNullOrEmpty(plain))
|
||||
return "";
|
||||
int idx = plain.IndexOf(keyword, StringComparison.OrdinalIgnoreCase);
|
||||
if (idx < 0)
|
||||
return plain.Length > 120 ? plain.Substring(0, 120) + "……" : plain;
|
||||
int start = Math.Max(0, idx - 40);
|
||||
int len = Math.Min(plain.Length - start, keyword.Length + 80);
|
||||
return (start > 0 ? "……" : "") + plain.Substring(start, len) + (start + len < plain.Length ? "……" : "");
|
||||
}
|
||||
|
||||
/// <summary>HTML 转纯文本(去标签、解码实体、压缩空白)。</summary>
|
||||
private static string HtmlToPlainText(string html)
|
||||
{
|
||||
if (string.IsNullOrEmpty(html))
|
||||
return "";
|
||||
string s = Regex.Replace(html, "(?i)<(br|/p|/div|/li|/tr|/h[1-6])[^>]*>", "\n");
|
||||
s = Regex.Replace(s, "<[^>]+>", "");
|
||||
s = System.Net.WebUtility.HtmlDecode(s);
|
||||
s = Regex.Replace(s, "[\r\n]+", "\n");
|
||||
s = Regex.Replace(s, "[ \t]+", " ");
|
||||
return s.Trim();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 维护:书籍
|
||||
/// <summary>
|
||||
/// 新增书籍(仅书名;FilePath/TotalPages/IndexStatus 与页面一致:NULL/0/2)。
|
||||
/// </summary>
|
||||
public static string AddBook(string title, string createUser)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(title))
|
||||
throw new Exception("书名不能为空");
|
||||
if (string.IsNullOrWhiteSpace(createUser))
|
||||
createUser = "api";
|
||||
|
||||
string bookId = NewId("PB");
|
||||
SQLHelper.ExecutSql(
|
||||
"INSERT INTO dbo.Sys_PdfBook (BookId, Title, FilePath, TotalPages, IndexStatus, CreateUser, CreateTime) VALUES ('"
|
||||
+ SqlEsc(bookId) + "',N'" + SqlEsc(title.Trim()) + "',NULL,0,2,N'"
|
||||
+ SqlEsc(createUser) + "',GETDATE())");
|
||||
return bookId;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 维护:章节(新增 / 改名 / 删除 / 保存正文)
|
||||
/// <summary>
|
||||
/// 新增章节:parentChapterId 为空则为顶级章节,否则挂到指定父章节下(层级=父级+1)。
|
||||
/// SortNo 取全书当前最大值+1(与页面逻辑一致)。
|
||||
/// </summary>
|
||||
public static string AddChapter(string bookId, string parentChapterId, string chapterTitle, string createUser)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(bookId))
|
||||
throw new Exception("bookId 不能为空");
|
||||
if (string.IsNullOrWhiteSpace(chapterTitle))
|
||||
throw new Exception("章节名称不能为空");
|
||||
|
||||
int level = 1;
|
||||
if (!string.IsNullOrWhiteSpace(parentChapterId))
|
||||
{
|
||||
int parentLevel = GetInt(
|
||||
"SELECT ISNULL([Level],1) FROM dbo.Sys_PdfChapter WHERE ChapterId='" + SqlEsc(parentChapterId) + "'");
|
||||
if (parentLevel <= 0)
|
||||
throw new Exception("父章节不存在:" + parentChapterId);
|
||||
level = parentLevel + 1;
|
||||
}
|
||||
int sort = GetInt(
|
||||
"SELECT ISNULL(MAX(SortNo),0) FROM dbo.Sys_PdfChapter WHERE BookId='" + SqlEsc(bookId) + "'") + 1;
|
||||
|
||||
string chapterId = NewId("CH");
|
||||
SQLHelper.ExecutSql(
|
||||
"INSERT INTO dbo.Sys_PdfChapter (ChapterId, BookId, ParentChapterId, [Level], ChapterTitle, PageStart, PageEnd, [Text], SortNo) VALUES ('"
|
||||
+ SqlEsc(chapterId) + "','" + SqlEsc(bookId) + "',"
|
||||
+ (string.IsNullOrWhiteSpace(parentChapterId) ? "NULL" : "'" + SqlEsc(parentChapterId) + "'")
|
||||
+ "," + level + ",N'" + SqlEsc(chapterTitle.Trim()) + "',NULL,NULL,N''," + sort + ")");
|
||||
return chapterId;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 编辑章节:仅修改章节名称。
|
||||
/// </summary>
|
||||
public static void EditChapter(string chapterId, string chapterTitle)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(chapterId))
|
||||
throw new Exception("chapterId 不能为空");
|
||||
if (string.IsNullOrWhiteSpace(chapterTitle))
|
||||
throw new Exception("章节名称不能为空");
|
||||
if (GetInt("SELECT COUNT(*) FROM dbo.Sys_PdfChapter WHERE ChapterId='" + SqlEsc(chapterId) + "'") == 0)
|
||||
throw new Exception("章节不存在:" + chapterId);
|
||||
|
||||
SQLHelper.ExecutSql("UPDATE dbo.Sys_PdfChapter SET ChapterTitle=N'" + SqlEsc(chapterTitle.Trim())
|
||||
+ "' WHERE ChapterId='" + SqlEsc(chapterId) + "'");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除章节及其全部子章节(递归收集自身+后代后一次性删除)。
|
||||
/// </summary>
|
||||
public static int DeleteChapter(string chapterId)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(chapterId))
|
||||
throw new Exception("chapterId 不能为空");
|
||||
|
||||
DataTable dt = SQLHelper.GetDataTableRunText(
|
||||
"SELECT BookId FROM dbo.Sys_PdfChapter WHERE ChapterId=@ChapterId",
|
||||
new[] { new SqlParameter("@ChapterId", chapterId) });
|
||||
if (dt == null || dt.Rows.Count == 0)
|
||||
throw new Exception("章节不存在:" + chapterId);
|
||||
string bookId = dt.Rows[0]["BookId"].ToString();
|
||||
|
||||
var all = PdfBookService.GetChapters(bookId);
|
||||
var ids = new List<string> { chapterId };
|
||||
bool changed = true;
|
||||
while (changed)
|
||||
{
|
||||
changed = false;
|
||||
foreach (PdfChapter c in all)
|
||||
{
|
||||
if (!ids.Contains(c.ChapterId) && ids.Contains(c.ParentChapterId ?? ""))
|
||||
{
|
||||
ids.Add(c.ChapterId);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var sb = new StringBuilder();
|
||||
foreach (string id in ids)
|
||||
{
|
||||
if (sb.Length > 0)
|
||||
sb.Append(",");
|
||||
sb.Append("'").Append(id.Replace("'", "''")).Append("'");
|
||||
}
|
||||
SQLHelper.ExecutSql("DELETE FROM dbo.Sys_PdfChapter WHERE ChapterId IN (" + sb + ")");
|
||||
return ids.Count;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存章节正文(富文本 HTML,与页面"保存内容"一致)。
|
||||
/// </summary>
|
||||
public static void SaveContent(string chapterId, string content)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(chapterId))
|
||||
throw new Exception("chapterId 不能为空");
|
||||
if (GetInt("SELECT COUNT(*) FROM dbo.Sys_PdfChapter WHERE ChapterId='" + SqlEsc(chapterId) + "'") == 0)
|
||||
throw new Exception("章节不存在:" + chapterId);
|
||||
|
||||
SQLHelper.ExecutSql("UPDATE dbo.Sys_PdfChapter SET [Text]=N'" + SqlEsc(content ?? "")
|
||||
+ "' WHERE ChapterId='" + SqlEsc(chapterId) + "'");
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 工具
|
||||
/// <summary>SQL 字符串转义。</summary>
|
||||
private static string SqlEsc(string s)
|
||||
{
|
||||
return (s ?? "").Replace("'", "''");
|
||||
}
|
||||
|
||||
/// <summary>执行 SELECT 首行首列并转 int(查无返回0)。</summary>
|
||||
private static int GetInt(string sql)
|
||||
{
|
||||
DataTable dt = SQLHelper.GetDataTableRunText(sql, new SqlParameter[] { });
|
||||
if (dt == null || dt.Rows.Count == 0)
|
||||
return 0;
|
||||
object v = dt.Rows[0][0];
|
||||
return v == DBNull.Value || v == null ? 0 : Convert.ToInt32(v);
|
||||
}
|
||||
|
||||
/// <summary>生成业务主键(前缀+时间+随机,与页面一致)。</summary>
|
||||
private static string NewId(string prefix)
|
||||
{
|
||||
return prefix + DateTime.Now.ToString("yyyyMMddHHmmss")
|
||||
+ Guid.NewGuid().ToString("N").Substring(0, 4);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
+3
-1
@@ -169,6 +169,7 @@
|
||||
<Compile Include="API\APIUnitService.cs" />
|
||||
<Compile Include="API\APIUpLoadFileService.cs" />
|
||||
<Compile Include="API\APIUserService.cs" />
|
||||
<Compile Include="API\APIPdfBookService.cs" />
|
||||
<Compile Include="API\CQMS\ApiInspectionManagementService.cs" />
|
||||
<Compile Include="API\CQMS\APIQuantityManagementService.cs" />
|
||||
<Compile Include="API\CQMS\BreakdownProjectService.cs" />
|
||||
@@ -818,6 +819,7 @@
|
||||
<Compile Include="ErrLogInfo.cs" />
|
||||
<Compile Include="FriendlyException.cs" />
|
||||
<Compile Include="Common\Funs.cs" />
|
||||
<Compile Include="PdfBookService.cs" />
|
||||
<Compile Include="MethodRefelect.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="SessionName.cs" />
|
||||
@@ -1165,4 +1167,4 @@
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -0,0 +1,202 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>PDF 书籍视图模型。</summary>
|
||||
public class PdfBook
|
||||
{
|
||||
public string BookId { get; set; }
|
||||
public string Title { get; set; }
|
||||
public int ChapterCount { get; set; }
|
||||
public string Tag { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>PDF 章节(目录项)视图模型,支持多级目录(含父章节与层级)。</summary>
|
||||
public class PdfChapter
|
||||
{
|
||||
public string ChapterId { get; set; }
|
||||
public string BookId { get; set; }
|
||||
public string ParentChapterId { get; set; } // 上一级章节,NULL=顶级
|
||||
public int Level { get; set; } // 层级:1章 2节 3小节
|
||||
public string Title { get; set; }
|
||||
public int PageStart { get; set; }
|
||||
public int PageEnd { get; set; }
|
||||
public int SortNo { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>章节正文视图模型。</summary>
|
||||
public class PdfChapterDetail
|
||||
{
|
||||
public string ChapterId { get; set; }
|
||||
public string Title { get; set; }
|
||||
public int PageStart { get; set; }
|
||||
public int PageEnd { get; set; }
|
||||
public string Content { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// PDF 书籍目录/正文读取服务。
|
||||
/// 优先读取数据库表 Sys_PdfBook / Sys_PdfChapter;当库无数据或未建表时,回退到内置示例数据,便于界面预览。
|
||||
/// </summary>
|
||||
public static class PdfBookService
|
||||
{
|
||||
// —— 内置示例数据(仅用于 UI 预览)——
|
||||
private const string SampleBookId = "SAMPLE_SP_001";
|
||||
private static readonly List<PdfBook> _sampleBooks = new List<PdfBook>
|
||||
{
|
||||
new PdfBook { BookId = SampleBookId, Title = "《建筑施工安全防护(示例)》", Tag = "示例数据", ChapterCount = 15 }
|
||||
};
|
||||
|
||||
// 多级目录示例(对应真实书籍:第一章 → 1.1 → 1.2.1)
|
||||
private static readonly List<PdfChapter> _sampleChapters = new List<PdfChapter>
|
||||
{
|
||||
Ch("CH01", "第一章 安全防护", 1, 1, 1, 1, null),
|
||||
Ch("CH011", "1.1 \u201c三宝\u201d\u201c四口\u201d\u201c五临边\u201d", 1, 1, 2, 2, "CH01"),
|
||||
Ch("CH012", "1.2 三宝", 1, 3, 3, 2, "CH01"),
|
||||
Ch("CH0121", "1.2.1 安全帽", 1, 1, 4, 3, "CH012"),
|
||||
Ch("CH0122", "1.2.2 安全带", 2, 2, 5, 3, "CH012"),
|
||||
Ch("CH0123", "1.2.3 安全网", 3, 3, 6, 3, "CH012"),
|
||||
Ch("CH013", "1.3 \u201c四口\u201d安全防护", 4, 6, 7, 2, "CH01"),
|
||||
Ch("CH0131", "1.3.1 电梯井竖向洞口防护", 4, 4, 8, 3, "CH013"),
|
||||
Ch("CH0132", "1.3.2 预留洞口安全防护", 5, 5, 9, 3, "CH013"),
|
||||
Ch("CH0133", "1.3.3 通道口安全防护", 6, 6, 10, 3, "CH013"),
|
||||
Ch("CH014", "1.4 \u201c五临边\u201d安全防护", 10, 12, 11, 2, "CH01"),
|
||||
Ch("CH0141", "1.4.1 临边作业", 10, 10, 12, 3, "CH014"),
|
||||
Ch("CH0142", "1.4.2 基坑临边防护", 10, 10, 13, 3, "CH014"),
|
||||
Ch("CH0143", "1.4.3 楼层临边防护", 11, 11, 14, 3, "CH014"),
|
||||
Ch("CH0144", "1.4.4 楼梯临边防护", 12, 12, 15, 3, "CH014")
|
||||
};
|
||||
|
||||
private static readonly Dictionary<string, PdfChapterDetail> _sampleContents = new Dictionary<string, PdfChapterDetail>
|
||||
{
|
||||
{ "CH01", Detail("CH01", "第一章 安全防护", 1, 1, "本章为施工现场安全防护的总述,涵盖\u201c三宝\u201d\u201c四口\u201d\u201c五临边\u201d等基本防护要求。") },
|
||||
{ "CH011", Detail("CH011", "1.1 \u201c三宝\u201d\u201c四口\u201d\u201c五临边\u201d", 1, 1, "本节概述安全帽、安全带、安全网\u201c三宝\u201d,简称、预留洞口等\u201c四口\u201d以及临边等\u201c五临边\u201d的防护要点。") },
|
||||
{ "CH012", Detail("CH012", "1.2 三宝", 1, 3, "三宝指安全帽、安全带、安全网,是施工现场最基本的个人防护用品。") },
|
||||
{ "CH0121", Detail("CH0121", "1.2.1 安全帽", 1, 1, "进入施工现场必须正确佩戴安全帽,并系紧下颏带;安全帽应符合国家标准,不得使用破损或过期的安全帽。") },
|
||||
{ "CH0122", Detail("CH0122", "1.2.2 安全带", 2, 2, "高处作业应正确使用安全带,做到高挂低用,系挂在牢固可靠的结构上,严禁低挂高用。") },
|
||||
{ "CH0123", Detail("CH0123", "1.2.3 安全网", 3, 3, "作业面周围应按要求张挂安全平网或立网,安全网应绑扎牢固、无破损,严禁随意拆除。") },
|
||||
{ "CH013", Detail("CH013", "1.3 \u201c四口\u201d安全防护", 4, 6, "四口指楼梯口、电梯井口、预留洞口、通道口,均应设置可靠的防护设施。") },
|
||||
{ "CH0131", Detail("CH0131", "1.3.1 电梯井竖向洞口防护", 4, 4, "电梯井口应设置固定式防护门,井内每隔两层并不超过10m设置一道安全平网。") },
|
||||
{ "CH0132", Detail("CH0132", "1.3.2 预留洞口安全防护", 5, 5, "楼板、屋面等预留洞口应设置盖板或围挡防护,并设置警示标志。") },
|
||||
{ "CH0133", Detail("CH0133", "1.3.3 通道口安全防护", 6, 6, "通道口应搭设防护棚,并设置明显的安全警示标志和夜间警示灯。") },
|
||||
{ "CH014", Detail("CH014", "1.4 \u201c五临边\u201d安全防护", 10, 12, "五临边指基坑边、楼层边、屋面边、阳台边、楼梯边等临边作业场所,均应设置防护栏杆。") },
|
||||
{ "CH0141", Detail("CH0141", "1.4.1 临边作业", 10, 10, "临边作业应设置防护栏杆并挂设安全网,作业人员应正确佩戴和使用安全带。") },
|
||||
{ "CH0142", Detail("CH0142", "1.4.2 基坑临边防护", 10, 10, "基坑周边应设置高度不低于1.2m的防护栏杆,并设置警示与夜间警示灯。") },
|
||||
{ "CH0143", Detail("CH0143", "1.4.3 楼层临边防护", 11, 11, "楼层临边应设置防护栏杆和挡脚板,严防人员坠落和物件坠落伤人。") },
|
||||
{ "CH0144", Detail("CH0144", "1.4.4 楼梯临边防护", 12, 12, "楼梯临边、休息平台等部位应设置临时防护栏杆,随层随设。") }
|
||||
};
|
||||
|
||||
private static PdfChapter Ch(string id, string title, int start, int end, int sort, int level, string parent)
|
||||
{
|
||||
return new PdfChapter
|
||||
{
|
||||
ChapterId = id, BookId = SampleBookId, Title = title,
|
||||
PageStart = start, PageEnd = end, SortNo = sort, Level = level, ParentChapterId = parent
|
||||
};
|
||||
}
|
||||
|
||||
private static PdfChapterDetail Detail(string id, string title, int pageStart, int pageEnd, string content)
|
||||
{
|
||||
return new PdfChapterDetail { ChapterId = id, Title = title, PageStart = pageStart, PageEnd = pageEnd, Content = content };
|
||||
}
|
||||
|
||||
/// <summary>获取书籍列表。</summary>
|
||||
public static List<PdfBook> GetBooks()
|
||||
{
|
||||
try
|
||||
{
|
||||
DataTable dt = SQLHelper.GetDataTableRunText(
|
||||
"SELECT BookId, Title FROM dbo.Sys_PdfBook ORDER BY CreateTime", new SqlParameter[] { });
|
||||
if (dt != null && dt.Rows.Count > 0)
|
||||
{
|
||||
var list = new List<PdfBook>();
|
||||
foreach (DataRow r in dt.Rows)
|
||||
list.Add(new PdfBook
|
||||
{
|
||||
BookId = r["BookId"] == null ? "" : r["BookId"].ToString(),
|
||||
Title = r["Title"] == null ? "" : r["Title"].ToString(),
|
||||
Tag = "数据库"
|
||||
});
|
||||
return list;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// 未建表或查询失败,回退示例数据
|
||||
}
|
||||
return _sampleBooks;
|
||||
}
|
||||
|
||||
/// <summary>获取某本书的章节(目录,含层级与父章节,供页面递归建树)。</summary>
|
||||
public static List<PdfChapter> GetChapters(string bookId)
|
||||
{
|
||||
if (bookId == SampleBookId)
|
||||
return _sampleChapters;
|
||||
|
||||
try
|
||||
{
|
||||
DataTable dt = SQLHelper.GetDataTableRunText(
|
||||
"SELECT ChapterId, BookId, ParentChapterId, [Level], ChapterTitle, PageStart, PageEnd, SortNo " +
|
||||
"FROM dbo.Sys_PdfChapter WHERE BookId=@BookId ORDER BY SortNo",
|
||||
new[] { new SqlParameter("@BookId", bookId) });
|
||||
var list = new List<PdfChapter>();
|
||||
if (dt != null)
|
||||
foreach (DataRow r in dt.Rows)
|
||||
{
|
||||
var c = new PdfChapter
|
||||
{
|
||||
ChapterId = r["ChapterId"] == null ? "" : r["ChapterId"].ToString(),
|
||||
BookId = r["BookId"] == null ? "" : r["BookId"].ToString(),
|
||||
ParentChapterId = r["ParentChapterId"] == DBNull.Value ? null : r["ParentChapterId"].ToString(),
|
||||
Title = r["ChapterTitle"] == null ? "" : r["ChapterTitle"].ToString(),
|
||||
SortNo = r["SortNo"] == DBNull.Value ? 0 : Convert.ToInt32(r["SortNo"]),
|
||||
Level = r["Level"] == DBNull.Value ? 1 : Convert.ToInt32(r["Level"])
|
||||
};
|
||||
c.PageStart = r["PageStart"] == DBNull.Value ? 0 : Convert.ToInt32(r["PageStart"]);
|
||||
c.PageEnd = r["PageEnd"] == DBNull.Value ? 0 : Convert.ToInt32(r["PageEnd"]);
|
||||
list.Add(c);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return new List<PdfChapter>();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>获取章节正文。</summary>
|
||||
public static PdfChapterDetail GetChapterContent(string chapterId)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(chapterId) && chapterId.StartsWith("CH") && _sampleContents.ContainsKey(chapterId))
|
||||
return _sampleContents[chapterId];
|
||||
|
||||
try
|
||||
{
|
||||
DataTable dt = SQLHelper.GetDataTableRunText(
|
||||
"SELECT ChapterId, ChapterTitle, PageStart, PageEnd, [Text] FROM dbo.Sys_PdfChapter WHERE ChapterId=@ChapterId",
|
||||
new[] { new SqlParameter("@ChapterId", chapterId) });
|
||||
if (dt != null && dt.Rows.Count > 0)
|
||||
{
|
||||
DataRow r = dt.Rows[0];
|
||||
return new PdfChapterDetail
|
||||
{
|
||||
ChapterId = r["ChapterId"] == null ? "" : r["ChapterId"].ToString(),
|
||||
Title = r["ChapterTitle"] == null ? "" : r["ChapterTitle"].ToString(),
|
||||
PageStart = r["PageStart"] == DBNull.Value ? 0 : Convert.ToInt32(r["PageStart"]),
|
||||
PageEnd = r["PageEnd"] == DBNull.Value ? 0 : Convert.ToInt32(r["PageEnd"]),
|
||||
Content = r["Text"] == DBNull.Value ? "" : r["Text"].ToString()
|
||||
};
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// 未建表或查询失败
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -284,13 +284,7 @@ namespace BLL
|
||||
}
|
||||
public static ListItem[] GetUnitWork(string projectId)
|
||||
{
|
||||
List<Model.WBS_UnitWork> q = (from x in Funs.DB.WBS_UnitWork where x.ProjectId == projectId && x.SuperUnitWork == null orderby x.UnitWorkCode select x).ToList();
|
||||
ListItem[] item = new ListItem[q.Count()];
|
||||
for (int i = 0; i < q.Count(); i++)
|
||||
{
|
||||
item[i] = new ListItem((q[i].UnitWorkCode + "-" + q[i].UnitWorkName + GetProjectType(q[i].ProjectType)) ?? "", q[i].UnitWorkId.ToString());
|
||||
}
|
||||
return item;
|
||||
return GetUnitWorkList(projectId);
|
||||
}
|
||||
public static ListItem[] GetUnitWork(string projectId,string installationId)
|
||||
{
|
||||
@@ -335,16 +329,9 @@ namespace BLL
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
public static void InitUnitWorkDownList(FineUIPro.DropDownList dropName, string projectId,string unitId, bool isShowPlease)
|
||||
public static void InitUnitWorkDownList(FineUIPro.DropDownList dropName, string projectId, string unitId, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "Value";
|
||||
dropName.DataTextField = "Text";
|
||||
dropName.DataSource = BLL.UnitWorkService.GetUnitWorkList(projectId);
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
InitUnitWorkDownList(dropName, projectId, isShowPlease);
|
||||
}
|
||||
/// <summary>
|
||||
/// 单位工程表下拉框
|
||||
@@ -484,26 +471,29 @@ namespace BLL
|
||||
return unitWorkName;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取单位工程下拉列表数据源
|
||||
/// </summary>
|
||||
private static object GetUnitWorkDropDownSource(string projectId)
|
||||
{
|
||||
return from x in Funs.DB.WBS_UnitWork
|
||||
where x.ProjectId == projectId && x.SuperUnitWork == null
|
||||
orderby x.UnitWorkCode
|
||||
select new
|
||||
{
|
||||
x.UnitWorkId,
|
||||
UnitWorkName = GetUnitWorkALLName(x.UnitWorkId)
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取单位工程下拉列表
|
||||
/// </summary>
|
||||
/// <param name="dropName"></param>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="isShowPlease"></param>
|
||||
public static void InitUnitWorkDropDownList(FineUIPro.DropDownList dropName, string projectId, bool isShowPlease)
|
||||
{
|
||||
var unitWorks = from x in Funs.DB.WBS_UnitWork
|
||||
where x.ProjectId == projectId && x.SuperUnitWork == null
|
||||
orderby x.UnitWorkCode
|
||||
select new
|
||||
{
|
||||
x.UnitWorkId,
|
||||
UnitWorkName = GetUnitWorkALLName(x.UnitWorkId)
|
||||
};
|
||||
|
||||
dropName.DataValueField = "UnitWorkId";
|
||||
dropName.DataTextField = "UnitWorkName";
|
||||
dropName.DataSource = unitWorks;
|
||||
dropName.DataSource = GetUnitWorkDropDownSource(projectId);
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
@@ -512,25 +502,13 @@ namespace BLL
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取单位工程下拉列表
|
||||
/// 获取单位工程名称下拉列表
|
||||
/// </summary>
|
||||
/// <param name="dropName"></param>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="isShowPlease"></param>
|
||||
public static void InitUnitWorkNameDropDownList(FineUIPro.DropDownList dropName, string projectId, bool isShowPlease)
|
||||
{
|
||||
var unitWorks = from x in Funs.DB.WBS_UnitWork
|
||||
where x.ProjectId == projectId && x.SuperUnitWork == null
|
||||
orderby x.UnitWorkCode
|
||||
select new
|
||||
{
|
||||
x.UnitWorkId,
|
||||
UnitWorkName = GetUnitWorkALLName(x.UnitWorkId)
|
||||
};
|
||||
|
||||
dropName.DataValueField = "UnitWorkName";
|
||||
dropName.DataTextField = "UnitWorkName";
|
||||
dropName.DataSource = unitWorks;
|
||||
dropName.DataSource = GetUnitWorkDropDownSource(projectId);
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
|
||||
@@ -289,6 +289,51 @@ namespace BLL
|
||||
select x).FirstOrDefault();
|
||||
return q;
|
||||
}
|
||||
/// <summary>
|
||||
/// 汇总项目质量数据生成单位级CQMS汇总记录
|
||||
/// </summary>
|
||||
private static CQMSData_CQMS BuildCqmsSummary(string unitId, Model.Base_Unit baseUnit, List<Model.Project_CQMSData_CQMS> projectData)
|
||||
{
|
||||
return new CQMSData_CQMS
|
||||
{
|
||||
UnitId = unitId,
|
||||
CollCropCode = baseUnit.CollCropCode,
|
||||
UnitName = baseUnit.UnitName,
|
||||
ReportDate = DateTime.Now.Date,
|
||||
TrainPersonNum = projectData.Sum(x => x.TrainPersonNum),
|
||||
TechnicalDisclosePersonNum = projectData.Sum(x => x.TechnicalDisclosePersonNum),
|
||||
UseNum = projectData.Sum(x => x.UseNum),
|
||||
OKNum = projectData.Sum(x => x.OKNum),
|
||||
CompanyPersonNum = GetCompanyPersonNum(),
|
||||
BranchPersonNum = GetBranchPersonNum(),
|
||||
ProjectPersonNum = projectData.Sum(x => x.ProjectPersonNum),
|
||||
ProblemNum = projectData.Sum(x => x.ProblemNum),
|
||||
ProblemCompletedNum = projectData.Sum(x => x.ProblemCompletedNum),
|
||||
ProblemNotCompletedNum = projectData.Sum(x => x.ProblemNotCompletedNum),
|
||||
SNum = projectData.Sum(x => x.SNum),
|
||||
ANum = projectData.Sum(x => x.ANum),
|
||||
BNum = projectData.Sum(x => x.BNum),
|
||||
CNum = projectData.Sum(x => x.CNum),
|
||||
KeyProcessNum = projectData.Sum(x => x.KeyProcessNum),
|
||||
KeyProcessOKNum = projectData.Sum(x => x.KeyProcessOKNum),
|
||||
SpecialProcessNum = projectData.Sum(x => x.SpecialProcessNum),
|
||||
SpecialProcessOKNum = projectData.Sum(x => x.SpecialProcessOKNum),
|
||||
ConcealedWorksNum = projectData.Sum(x => x.ConcealedWorksNum),
|
||||
ConcealedWorksOKNum = projectData.Sum(x => x.ConcealedWorksOKNum),
|
||||
UnitProjectOnesNum = projectData.Sum(x => x.UnitProjectOnesNum),
|
||||
UnitProjectOnesOKNum = projectData.Sum(x => x.UnitProjectOnesOKNum),
|
||||
MaterialInRecheckNum = projectData.Sum(x => x.MaterialInRecheckNum),
|
||||
MaterialInRecheckOKNum = projectData.Sum(x => x.MaterialInRecheckOKNum),
|
||||
SingleProjectNum = projectData.Sum(x => x.SingleProjectNum),
|
||||
UnitProjectNum = projectData.Sum(x => x.UnitProjectNum),
|
||||
SubProjectNum = projectData.Sum(x => x.SubProjectNum),
|
||||
SubdivisionalWorksNum = projectData.Sum(x => x.SubdivisionalWorksNum),
|
||||
InspectionLotNum = projectData.Sum(x => x.InspectionLotNum),
|
||||
CreateMan = Const.sysglyId,
|
||||
CreateDate = DateTime.Now
|
||||
};
|
||||
}
|
||||
|
||||
public static CQMSData_CQMS GetSubUnitCqmsDataByDate(string Unitid, DateTime? reportdate)
|
||||
{
|
||||
|
||||
@@ -302,44 +347,7 @@ namespace BLL
|
||||
var ProjectData = (from x in Funs.DB.Project_CQMSData_CQMS
|
||||
where x.ReportDate == reportdate && projectlist.Select(e => e.ProjectId).Contains(x.ProjectId)
|
||||
select x).ToList();
|
||||
result = new CQMSData_CQMS
|
||||
{
|
||||
UnitId = Unitid,
|
||||
CollCropCode = base_Unit.CollCropCode,
|
||||
UnitName = base_Unit.UnitName,
|
||||
ReportDate = DateTime.Now.Date,
|
||||
TrainPersonNum = ProjectData.Sum(x => x.TrainPersonNum),
|
||||
TechnicalDisclosePersonNum = ProjectData.Sum(x => x.TechnicalDisclosePersonNum),
|
||||
UseNum = ProjectData.Sum(x => x.UseNum),
|
||||
OKNum = ProjectData.Sum(x => x.OKNum),
|
||||
CompanyPersonNum = GetCompanyPersonNum(),
|
||||
BranchPersonNum = GetBranchPersonNum(),
|
||||
ProjectPersonNum = ProjectData.Sum(x => x.ProjectPersonNum),
|
||||
ProblemNum = ProjectData.Sum(x => x.ProblemNum),
|
||||
ProblemCompletedNum = ProjectData.Sum(x => x.ProblemCompletedNum),
|
||||
ProblemNotCompletedNum = ProjectData.Sum(x => x.ProblemNotCompletedNum),
|
||||
SNum = ProjectData.Sum(x => x.SNum),
|
||||
ANum = ProjectData.Sum(x => x.ANum),
|
||||
BNum = ProjectData.Sum(x => x.BNum),
|
||||
CNum = ProjectData.Sum(x => x.CNum),
|
||||
KeyProcessNum = ProjectData.Sum(x => x.KeyProcessNum),
|
||||
KeyProcessOKNum = ProjectData.Sum(x => x.KeyProcessOKNum),
|
||||
SpecialProcessNum = ProjectData.Sum(x => x.SpecialProcessNum),
|
||||
SpecialProcessOKNum = ProjectData.Sum(x => x.SpecialProcessOKNum),
|
||||
ConcealedWorksNum = ProjectData.Sum(x => x.ConcealedWorksNum),
|
||||
ConcealedWorksOKNum = ProjectData.Sum(x => x.ConcealedWorksOKNum),
|
||||
UnitProjectOnesNum = ProjectData.Sum(x => x.UnitProjectOnesNum),
|
||||
UnitProjectOnesOKNum = ProjectData.Sum(x => x.UnitProjectOnesOKNum),
|
||||
MaterialInRecheckNum = ProjectData.Sum(x => x.MaterialInRecheckNum),
|
||||
MaterialInRecheckOKNum = ProjectData.Sum(x => x.MaterialInRecheckOKNum),
|
||||
SingleProjectNum = ProjectData.Sum(x => x.SingleProjectNum),
|
||||
UnitProjectNum = ProjectData.Sum(x => x.UnitProjectNum),
|
||||
SubProjectNum = ProjectData.Sum(x => x.SubProjectNum),
|
||||
SubdivisionalWorksNum = ProjectData.Sum(x => x.SubdivisionalWorksNum),
|
||||
InspectionLotNum = ProjectData.Sum(x => x.InspectionLotNum),
|
||||
CreateMan = Const.sysglyId,
|
||||
CreateDate = DateTime.Now
|
||||
};
|
||||
result = BuildCqmsSummary(Unitid, base_Unit, ProjectData);
|
||||
return result;
|
||||
}
|
||||
public static void UpdateTodyData_State()
|
||||
@@ -396,44 +404,7 @@ namespace BLL
|
||||
var ProjectData = (from x in Funs.DB.Project_CQMSData_CQMS
|
||||
where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
|
||||
select x).ToList();
|
||||
var table = new CQMSData_CQMS
|
||||
{
|
||||
UnitId = thisUnitId,
|
||||
CollCropCode = base_Unit.CollCropCode,
|
||||
UnitName = base_Unit.UnitName,
|
||||
ReportDate = DateTime.Now.Date,
|
||||
TrainPersonNum = ProjectData.Sum(x => x.TrainPersonNum),
|
||||
TechnicalDisclosePersonNum = ProjectData.Sum(x => x.TechnicalDisclosePersonNum),
|
||||
UseNum = ProjectData.Sum(x => x.UseNum),
|
||||
OKNum = ProjectData.Sum(x => x.OKNum),
|
||||
CompanyPersonNum = GetCompanyPersonNum(),
|
||||
BranchPersonNum = GetBranchPersonNum(),
|
||||
ProjectPersonNum = ProjectData.Sum(x => x.ProjectPersonNum),
|
||||
ProblemNum = ProjectData.Sum(x => x.ProblemNum),
|
||||
ProblemCompletedNum = ProjectData.Sum(x => x.ProblemCompletedNum),
|
||||
ProblemNotCompletedNum = ProjectData.Sum(x => x.ProblemNotCompletedNum),
|
||||
SNum = ProjectData.Sum(x => x.SNum),
|
||||
ANum = ProjectData.Sum(x => x.ANum),
|
||||
BNum = ProjectData.Sum(x => x.BNum),
|
||||
CNum = ProjectData.Sum(x => x.CNum),
|
||||
KeyProcessNum = ProjectData.Sum(x => x.KeyProcessNum),
|
||||
KeyProcessOKNum = ProjectData.Sum(x => x.KeyProcessOKNum),
|
||||
SpecialProcessNum = ProjectData.Sum(x => x.SpecialProcessNum),
|
||||
SpecialProcessOKNum = ProjectData.Sum(x => x.SpecialProcessOKNum),
|
||||
ConcealedWorksNum = ProjectData.Sum(x => x.ConcealedWorksNum),
|
||||
ConcealedWorksOKNum = ProjectData.Sum(x => x.ConcealedWorksOKNum),
|
||||
UnitProjectOnesNum = ProjectData.Sum(x => x.UnitProjectOnesNum),
|
||||
UnitProjectOnesOKNum = ProjectData.Sum(x => x.UnitProjectOnesOKNum),
|
||||
MaterialInRecheckNum = ProjectData.Sum(x => x.MaterialInRecheckNum),
|
||||
MaterialInRecheckOKNum = ProjectData.Sum(x => x.MaterialInRecheckOKNum),
|
||||
SingleProjectNum = ProjectData.Sum(x => x.SingleProjectNum),
|
||||
UnitProjectNum = ProjectData.Sum(x => x.UnitProjectNum),
|
||||
SubProjectNum = ProjectData.Sum(x => x.SubProjectNum),
|
||||
SubdivisionalWorksNum = ProjectData.Sum(x => x.SubdivisionalWorksNum),
|
||||
InspectionLotNum = ProjectData.Sum(x => x.InspectionLotNum),
|
||||
CreateMan = Const.sysglyId,
|
||||
CreateDate = DateTime.Now
|
||||
};
|
||||
var table = BuildCqmsSummary(thisUnitId, base_Unit, ProjectData);
|
||||
if (IsReportByToday())
|
||||
{
|
||||
table.Id = GetTodayData().Id;
|
||||
|
||||
@@ -2968,10 +2968,10 @@ namespace BLL
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取一般事故数
|
||||
/// 按事故等级获取在施项目事故列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<Model.AccidentOutput> GetGeneralAccident()
|
||||
/// <param name="accidentDegree">事故等级(1一般 2较大 3重大 4特别重大)</param>
|
||||
private static List<Model.AccidentOutput> GetAccidentByDegree(string accidentDegree)
|
||||
{
|
||||
var query = from Record in Funs.DB.Accident_AccidentReport
|
||||
join AccidentType in Funs.DB.Sys_Const on new { ConstValue = Record.AccidentTypeId, GroupId = "AccidentReportRegistration" } equals new { ConstValue = AccidentType.ConstValue, GroupId = AccidentType.GroupId } into AccidentTypeGroup
|
||||
@@ -2980,7 +2980,7 @@ namespace BLL
|
||||
from Project in ProjectGroup.DefaultIfEmpty()
|
||||
join Unit in Funs.DB.Base_Unit on Record.UnitId equals Unit.UnitId into UnitGroup
|
||||
from Unit in UnitGroup.DefaultIfEmpty()
|
||||
where Record.AccidentDate > Const.DtmarkTime && BeUnderConstructionList.Contains(Record.ProjectId) && Record.AccidentDegree == "1"
|
||||
where Record.AccidentDate > Const.DtmarkTime && BeUnderConstructionList.Contains(Record.ProjectId) && Record.AccidentDegree == accidentDegree
|
||||
select new AccidentOutput
|
||||
{
|
||||
Id = Record.AccidentReportId,
|
||||
@@ -2995,10 +2995,15 @@ namespace BLL
|
||||
Info = Record.Abstract
|
||||
};
|
||||
|
||||
var result = query.ToList();
|
||||
return query.ToList();
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
/// <summary>
|
||||
/// 获取一般事故数
|
||||
/// </summary>
|
||||
public static List<Model.AccidentOutput> GetGeneralAccident()
|
||||
{
|
||||
return GetAccidentByDegree("1");
|
||||
}
|
||||
|
||||
public static async Task<List<Model.AccidentOutput>> GetGeneralAccidentAsync()
|
||||
@@ -3009,33 +3014,9 @@ namespace BLL
|
||||
/// <summary>
|
||||
/// 获取较大事故数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<Model.AccidentOutput> GetMajorAccident()
|
||||
{
|
||||
var query = from Record in Funs.DB.Accident_AccidentReport
|
||||
join AccidentType in Funs.DB.Sys_Const on new { ConstValue = Record.AccidentTypeId, GroupId = "AccidentReportRegistration" } equals new { ConstValue = AccidentType.ConstValue, GroupId = AccidentType.GroupId } into AccidentTypeGroup
|
||||
from AccidentType in AccidentTypeGroup.DefaultIfEmpty()
|
||||
join Project in Funs.DB.Base_Project on Record.ProjectId equals Project.ProjectId into ProjectGroup
|
||||
from Project in ProjectGroup.DefaultIfEmpty()
|
||||
join Unit in Funs.DB.Base_Unit on Record.UnitId equals Unit.UnitId into UnitGroup
|
||||
from Unit in UnitGroup.DefaultIfEmpty()
|
||||
where Record.AccidentDate > Const.DtmarkTime && BeUnderConstructionList.Contains(Record.ProjectId) && Record.AccidentDegree == "2"
|
||||
select new AccidentOutput
|
||||
{
|
||||
Id = Record.AccidentReportId,
|
||||
ProjectId = Record.ProjectId,
|
||||
ProjectCode = Project.ProjectCode,
|
||||
ProjectName = Project.ProjectName,
|
||||
AccidentTypeName = AccidentType.ConstText,
|
||||
AccidentDate = Record.AccidentDate,
|
||||
UnitId = Unit.UnitId,
|
||||
UnitName = Unit.UnitName,
|
||||
PeopleNum = Record.PeopleNum,
|
||||
Info = Record.Abstract
|
||||
};
|
||||
|
||||
var result = query.ToList();
|
||||
return result;
|
||||
return GetAccidentByDegree("2");
|
||||
}
|
||||
|
||||
public static async Task<List<Model.AccidentOutput>> GetMajorAccidentAsync()
|
||||
@@ -3046,69 +3027,22 @@ namespace BLL
|
||||
/// <summary>
|
||||
/// 获取重大事故数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<Model.AccidentOutput> GetSeriousAccident()
|
||||
{
|
||||
var query = from Record in Funs.DB.Accident_AccidentReport
|
||||
join AccidentType in Funs.DB.Sys_Const on new { ConstValue = Record.AccidentTypeId, GroupId = "AccidentReportRegistration" } equals new { ConstValue = AccidentType.ConstValue, GroupId = AccidentType.GroupId } into AccidentTypeGroup
|
||||
from AccidentType in AccidentTypeGroup.DefaultIfEmpty()
|
||||
join Project in Funs.DB.Base_Project on Record.ProjectId equals Project.ProjectId into ProjectGroup
|
||||
from Project in ProjectGroup.DefaultIfEmpty()
|
||||
join Unit in Funs.DB.Base_Unit on Record.UnitId equals Unit.UnitId into UnitGroup
|
||||
from Unit in UnitGroup.DefaultIfEmpty()
|
||||
where Record.AccidentDate > Const.DtmarkTime && BeUnderConstructionList.Contains(Record.ProjectId) && Record.AccidentDegree == "3"
|
||||
select new AccidentOutput
|
||||
{
|
||||
Id = Record.AccidentReportId,
|
||||
ProjectId = Record.ProjectId,
|
||||
ProjectCode = Project.ProjectCode,
|
||||
ProjectName = Project.ProjectName,
|
||||
AccidentTypeName = AccidentType.ConstText,
|
||||
AccidentDate = Record.AccidentDate,
|
||||
UnitId = Unit.UnitId,
|
||||
UnitName = Unit.UnitName,
|
||||
PeopleNum = Record.PeopleNum,
|
||||
Info = Record.Abstract
|
||||
};
|
||||
|
||||
var result = query.ToList();
|
||||
return result;
|
||||
return GetAccidentByDegree("3");
|
||||
}
|
||||
|
||||
public static async Task<List<Model.AccidentOutput>> GetSeriousAccidentAsync()
|
||||
{
|
||||
return await Task.Run(GetSeriousAccident);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取特别重大事故数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<Model.AccidentOutput> GetSpecialSeriousAccident()
|
||||
{
|
||||
var query = from Record in Funs.DB.Accident_AccidentReport
|
||||
join AccidentType in Funs.DB.Sys_Const on new { ConstValue = Record.AccidentTypeId, GroupId = "AccidentReportRegistration" } equals new { ConstValue = AccidentType.ConstValue, GroupId = AccidentType.GroupId } into AccidentTypeGroup
|
||||
from AccidentType in AccidentTypeGroup.DefaultIfEmpty()
|
||||
join Project in Funs.DB.Base_Project on Record.ProjectId equals Project.ProjectId into ProjectGroup
|
||||
from Project in ProjectGroup.DefaultIfEmpty()
|
||||
join Unit in Funs.DB.Base_Unit on Record.UnitId equals Unit.UnitId into UnitGroup
|
||||
from Unit in UnitGroup.DefaultIfEmpty()
|
||||
where Record.AccidentDate > Const.DtmarkTime && BeUnderConstructionList.Contains(Record.ProjectId) && Record.AccidentDegree == "4"
|
||||
select new AccidentOutput
|
||||
{
|
||||
Id = Record.AccidentReportId,
|
||||
ProjectId = Record.ProjectId,
|
||||
ProjectCode = Project.ProjectCode,
|
||||
ProjectName = Project.ProjectName,
|
||||
AccidentTypeName = AccidentType.ConstText,
|
||||
AccidentDate = Record.AccidentDate,
|
||||
UnitId = Unit.UnitId,
|
||||
UnitName = Unit.UnitName,
|
||||
PeopleNum = Record.PeopleNum,
|
||||
Info = Record.Abstract
|
||||
};
|
||||
|
||||
var result = query.ToList();
|
||||
return result;
|
||||
return GetAccidentByDegree("4");
|
||||
}
|
||||
|
||||
public static async Task<List<Model.AccidentOutput>> GetSpecialSeriousAccidentAsync()
|
||||
|
||||
@@ -523,173 +523,132 @@ namespace BLL
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 按质量控制点级别(S/A/B/C)统计数量
|
||||
/// </summary>
|
||||
private static int GetClassNum(string projectid, string classType)
|
||||
{
|
||||
return (from x in Funs.DB.WBS_BreakdownProject
|
||||
where x.ProjectId == projectid && x.Class.Contains(classType) && x.IsSelected == true && x.CompileDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取S级数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetSNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.WBS_BreakdownProject
|
||||
where x.ProjectId == projectid && x.Class.Contains("S") && x.IsSelected == true && x.CompileDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
return GetClassNum(projectid, "S");
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取A级数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetANum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.WBS_BreakdownProject
|
||||
where x.ProjectId == projectid && x.Class.Contains("A") && x.IsSelected == true && x.CompileDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
return GetClassNum(projectid, "A");
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取B级数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetBNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.WBS_BreakdownProject
|
||||
where x.ProjectId == projectid && x.Class.Contains("B") && x.IsSelected == true && x.CompileDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
return GetClassNum(projectid, "B");
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取C级数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetCNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.WBS_BreakdownProject
|
||||
where x.ProjectId == projectid && x.Class.Contains("C") && x.IsSelected == true && x.CompileDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
return GetClassNum(projectid, "C");
|
||||
}
|
||||
/// <summary>
|
||||
/// 按验收类型统计验收数
|
||||
/// </summary>
|
||||
private static int GetInspectionNum(string projectid, string checkAcceptType)
|
||||
{
|
||||
return (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
where y.ProjectId == projectid && y.CheckAcceptType == checkAcceptType && x.CreateDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
}
|
||||
/// <summary>
|
||||
/// 按验收类型统计一次验收合格数
|
||||
/// </summary>
|
||||
private static int GetInspectionOkNum(string projectid, string checkAcceptType)
|
||||
{
|
||||
return (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId
|
||||
where y.ProjectId == projectid && y.CheckAcceptType == checkAcceptType && z.IsOnceQualified == true && x.CreateDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取关键工序验收数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetKeyProcessNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
where y.ProjectId == projectid && y.CheckAcceptType == "1" && x.CreateDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
return GetInspectionNum(projectid, "1");
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取关键工序验收合格数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetKeyProcessOkNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId
|
||||
where y.ProjectId == projectid && y.CheckAcceptType == "1" && z.IsOnceQualified == true && x.CreateDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
return GetInspectionOkNum(projectid, "1");
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取特殊过程验收数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetSpecialProcessNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
where y.ProjectId == projectid && y.CheckAcceptType == "2" && x.CreateDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
return GetInspectionNum(projectid, "2");
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取特殊过程验收合格数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetSpecialProcessOkNum(string projectid)
|
||||
{
|
||||
var result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId
|
||||
where y.ProjectId == projectid && y.CheckAcceptType == "2" && z.IsOnceQualified == true && x.CreateDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
return GetInspectionOkNum(projectid, "2");
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取隐蔽工程验收数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetConcealedWorksNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
where y.ProjectId == projectid && y.CheckAcceptType == "3" && x.CreateDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
return GetInspectionNum(projectid, "3");
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取隐蔽工程验收合格数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetConcealedWorksOkNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId
|
||||
where y.ProjectId == projectid && y.CheckAcceptType == "3" && z.IsOnceQualified == true && x.CreateDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
return GetInspectionOkNum(projectid, "3");
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取单位工程一次验收数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetUnitProjectOnesNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
where y.ProjectId == projectid && y.CheckAcceptType == "4" && x.CreateDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
return GetInspectionNum(projectid, "4");
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取单位工程一次验收合格数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetUnitProjectOnesOKNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId
|
||||
where y.ProjectId == projectid && y.CheckAcceptType == "4" && z.IsOnceQualified == true && x.CreateDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
return GetInspectionOkNum(projectid, "4");
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取材料进场复验数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetMaterialInRecheckNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
where y.ProjectId == projectid && y.CheckAcceptType == "5" && x.CreateDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
return GetInspectionNum(projectid, "5");
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取材料进场复验合格数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetMaterialInRecheckOKNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId
|
||||
where y.ProjectId == projectid && y.CheckAcceptType == "5" && z.IsOnceQualified == true && x.CreateDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
return GetInspectionOkNum(projectid, "5");
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取单项工程个数
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
@@ -2541,6 +2541,7 @@
|
||||
<Content Include="PZHGL\ProjectData\ProjectPageDataSave.aspx" />
|
||||
<Content Include="ReportPrint\PrintDesigner.aspx" />
|
||||
<Content Include="Doc\help.doc" />
|
||||
<Content Include="HSSE\PDFDOC\PdfBookView.aspx" />
|
||||
<Content Include="AttachFile\fileupload.ashx" />
|
||||
<Content Include="AttachFile\lib\README.md" />
|
||||
<Content Include="res\assets\css\index.css" />
|
||||
@@ -16114,6 +16115,13 @@
|
||||
<Compile Include="JDGL\CostAnalysis\EarnedValueCurve.aspx.designer.cs">
|
||||
<DependentUpon>EarnedValueCurve.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="HSSE\PDFDOC\PdfBookView.aspx.cs">
|
||||
<DependentUpon>PdfBookView.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="HSSE\PDFDOC\PdfBookView.aspx.designer.cs">
|
||||
<DependentUpon>PdfBookView.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="JDGL\CostAnalysis\PlanAdjust.aspx.cs">
|
||||
<DependentUpon>PlanAdjust.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
|
||||
@@ -0,0 +1,205 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PdfBookView.aspx.cs" Inherits="FineUIPro.Web.HSSE.PDFDOC.PdfBookView" ValidateRequest="false" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>PDF 书籍阅读</title>
|
||||
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
<style type="text/css">
|
||||
/* ============ PdfBookView 页面局部样式(pdfb- 前缀,仅本页生效) ============ */
|
||||
|
||||
/* 本页为全幅框架布局,去掉 common.css 的 body 15px 内边距 */
|
||||
body.f-body { padding: 0; }
|
||||
|
||||
/* ---- 顶部标题栏 ---- */
|
||||
.pdfb-topbar .f-panel-body { background: transparent !important; }
|
||||
.pdfb-hero {
|
||||
display: flex; align-items: center; height: 100%; box-sizing: border-box;
|
||||
padding: 0 20px 0 18px;
|
||||
background: linear-gradient(115deg, #143d59 0%, #1f5f8b 55%, #2e86ab 100%);
|
||||
box-shadow: inset 0 -1px 0 rgba(255,255,255,.12), 0 2px 6px rgba(16, 42, 67, .35);
|
||||
}
|
||||
.pdfb-hero-mark {
|
||||
flex: none; width: 38px; height: 38px; margin-right: 12px;
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25);
|
||||
border-radius: 9px;
|
||||
}
|
||||
.pdfb-hero-mark svg { width: 22px; height: 22px; fill: #ffffff; display: block; }
|
||||
.pdfb-hero-text { flex: 1 1 auto; min-width: 0; }
|
||||
.pdfb-hero-title {
|
||||
font-size: 17px; font-weight: 600; color: #ffffff; letter-spacing: 1px;
|
||||
text-shadow: 0 1px 2px rgba(0,0,0,.25);
|
||||
}
|
||||
.pdfb-hero-sub { margin-top: 3px; font-size: 12px; color: rgba(255,255,255,.78); letter-spacing: .5px; }
|
||||
.pdfb-hero-tip {
|
||||
flex: none; margin-left: 16px; padding: 5px 12px;
|
||||
font-size: 12px; color: #d8ecf8;
|
||||
border: 1px dashed rgba(255,255,255,.35); border-radius: 12px;
|
||||
background: rgba(255,255,255,.07);
|
||||
}
|
||||
|
||||
/* ---- 左栏目录 ---- */
|
||||
.pdfb-left .f-panel-header .f-panel-title-text { font-weight: 600; }
|
||||
.pdfb-tree .f-tree-bodyct { padding: 3px 0 8px 0; }
|
||||
|
||||
/* ---- 中部内容区:纯白画布,编辑器与下方留白同色 ---- */
|
||||
.pdfb-center { background: #ffffff; }
|
||||
.pdfb-center .f-panel-body,
|
||||
.pdfb-center .f-field-htmleditor-wrap { background: #ffffff !important; }
|
||||
.pdfb-status { color: #6b7f93; font-size: 12px; }
|
||||
|
||||
/* 主操作按钮(保存内容)强调色 */
|
||||
a.pdfb-btn-primary, .pdfb-btn-primary {
|
||||
background: linear-gradient(#33739c, #22557a) !important;
|
||||
border: 1px solid #1b4562 !important;
|
||||
}
|
||||
.pdfb-btn-primary .f-btn-text { color: #ffffff !important; }
|
||||
.pdfb-btn-primary:hover { background: linear-gradient(#3c82b0, #28618c) !important; }
|
||||
.pdfb-btn-primary .f-btn-icon { color: #ffffff !important; }
|
||||
|
||||
/* 树节点行高与悬停(若类名匹配则生效,不匹配自动忽略) */
|
||||
.pdfb-tree .f-tree-row td { padding-top: 3px; padding-bottom: 3px; }
|
||||
.pdfb-tree .f-tree-row:hover > td { background: #e3f1fa !important; }
|
||||
|
||||
/* ---- 弹窗 ---- */
|
||||
.pdfb-window .f-panel-body { padding-top: 6px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
|
||||
<f:HiddenField ID="hfCurrentChapterId" runat="server"></f:HiddenField>
|
||||
<f:HiddenField ID="hfEditChapterId" runat="server"></f:HiddenField>
|
||||
<f:Panel ID="Panel1" runat="server" ShowBorder="false" ShowHeader="false" Layout="Region">
|
||||
<Items>
|
||||
<%-- 左栏:书籍选择 + 目录树 --%>
|
||||
<f:Panel runat="server" ID="panelLeftRegion" RegionPosition="Left" RegionSplit="true"
|
||||
EnableCollapse="true" Width="300" Title="书籍目录" TitleToolTip="书籍目录(多级章节)"
|
||||
IconFont="Book" CssClass="pdfb-left"
|
||||
ShowBorder="true" ShowHeader="true" AutoScroll="true" BodyPadding="0px">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Left">
|
||||
<Items>
|
||||
<f:DropDownList ID="drpBook" runat="server" Label="书籍" LabelWidth="60px" Width="200px"
|
||||
EnableEdit="false" AutoPostBack="true" OnSelectedIndexChanged="drpBook_SelectedIndexChanged">
|
||||
</f:DropDownList>
|
||||
<f:Button ID="btnAddBook" runat="server" Text="新增" IconFont="PlusCircle" ToolTip="手动新增一本书籍"
|
||||
OnClick="btnAddBook_Click">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
<f:Toolbar ID="Toolbar3" Position="Top" runat="server" ToolbarAlign="Left">
|
||||
<Items>
|
||||
<f:Button ID="btnAddChapter" runat="server" Text="新增章节" IconFont="PlusCircle"
|
||||
ToolTip="在选中节点下新增章节(未选中则为顶级)" OnClick="btnAddChapter_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnEditChapter" runat="server" Text="编辑" IconFont="Pencil"
|
||||
ToolTip="修改选中章节名称" OnClick="btnEditChapter_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnDelChapter" runat="server" Text="删除" IconFont="TrashO"
|
||||
ToolTip="删除选中章节及其子章节" ConfirmText="将删除选中章节及其全部子章节,确定删除?"
|
||||
ConfirmTarget="Top" OnClick="btnDelChapter_Click">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Items>
|
||||
<f:Tree ID="trCatalog" EnableCollapse="true" ShowHeader="false" EnableIcons="true"
|
||||
AutoLeafIdentification="true" OnNodeCommand="trCatalog_NodeCommand" runat="server"
|
||||
CssClass="pdfb-tree">
|
||||
</f:Tree>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<%-- 中部:章节内容编辑 --%>
|
||||
<f:Panel runat="server" ID="panelCenterRegion" RegionPosition="Center" ShowBorder="false"
|
||||
Layout="Fit" ShowHeader="false" CssClass="pdfb-center" BodyPadding="10px" AutoScroll="true">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
|
||||
<Items>
|
||||
<f:Button ID="btnSaveContent" runat="server" Text="保存内容" IconFont="Save" CssClass="pdfb-btn-primary"
|
||||
ToolTip="保存当前章节的富文本内容(文字+图片)" OnClick="btnSaveContent_Click">
|
||||
</f:Button>
|
||||
<f:ToolbarFill ID="ToolbarFill2" runat="server"></f:ToolbarFill>
|
||||
<f:Label ID="lblProgress" runat="server" Text="" CssClass="pdfb-status">
|
||||
</f:Label>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Items>
|
||||
<f:HtmlEditor ID="htmlContent" runat="server" ShowLabel="false" Editor="UMEditor"
|
||||
BasePath="~/res/umeditor/" ToolbarSet="Full" LabelAlign="Right" Height="780">
|
||||
</f:HtmlEditor>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Window ID="WindowBook" Title="新增书籍" Icon="BookAdd" Hidden="true" IsModal="true" EnableMaximize="false"
|
||||
Target="Parent" Width="440px" Height="190px" CssClass="pdfb-window" runat="server">
|
||||
<Items>
|
||||
<f:Form ID="formBook" ShowBorder="false" ShowHeader="false" AutoScroll="true" BodyPadding="10px"
|
||||
LabelAlign="Right" runat="server">
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtBookTitle" runat="server" Label="书名" Width="340px" MaxLength="200"
|
||||
EmptyText="请输入书名" ShowRedStar="true" Required="true">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="ToolbarBook" Position="Bottom" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:ToolbarFill runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnSaveBook" Icon="SystemSave" Text="保存" runat="server" ValidateForms="formBook"
|
||||
OnClick="btnSaveBook_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnCloseBook" Icon="SystemClose" Text="关闭" runat="server" OnClick="btnCloseBook_Click">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
</f:Form>
|
||||
</Items>
|
||||
</f:Window>
|
||||
<f:Window ID="WindowChapter" Title="新增章节" Icon="Bookmark" Hidden="true" IsModal="true" EnableMaximize="false"
|
||||
Target="Parent" Width="440px" Height="210px" CssClass="pdfb-window" runat="server">
|
||||
<Items>
|
||||
<f:Form ID="formChapter" ShowBorder="false" ShowHeader="false" AutoScroll="true" BodyPadding="10px"
|
||||
LabelAlign="Right" runat="server">
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtChapterTitle" runat="server" Label="章节名称" Width="340px" MaxLength="200"
|
||||
EmptyText="请输入章节名称" ShowRedStar="true" Required="true">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:Label ID="lblParentChapter" runat="server" Label="位置" Text="顶级章节">
|
||||
</f:Label>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="ToolbarChapter" Position="Bottom" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:ToolbarFill runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnSaveChapter" Icon="SystemSave" Text="保存" runat="server" ValidateForms="formChapter"
|
||||
OnClick="btnSaveChapter_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnCloseChapter" Icon="SystemClose" Text="关闭" runat="server" OnClick="btnCloseChapter_Click">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
</f:Form>
|
||||
</Items>
|
||||
</f:Window>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,431 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using BLL;
|
||||
|
||||
namespace FineUIPro.Web.HSSE.PDFDOC
|
||||
{
|
||||
/// <summary>
|
||||
/// PDF 书籍维护页:左侧多级目录树 + 右侧富文本内容编辑(UMEditor,可输入文字、上传图片)。
|
||||
/// 章节与内容全部手动录入维护:新增书籍 / 新增·编辑·删除章节 / 保存章节富文本内容。
|
||||
/// 数据存 Sys_PdfBook / Sys_PdfChapter(内容为 HTML;上传图片在保存时转为 base64 内嵌,正文自包含)。
|
||||
/// </summary>
|
||||
public partial class PdfBookView : PageBase
|
||||
{
|
||||
#region 页面加载
|
||||
/// <summary>
|
||||
/// 页面加载。
|
||||
/// </summary>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
// 显式指定 UTF-8 编码,避免个别环境下中文乱码
|
||||
this.Response.ContentEncoding = System.Text.Encoding.UTF8;
|
||||
this.Response.Charset = "utf-8";
|
||||
|
||||
if (!IsPostBack)
|
||||
{
|
||||
BindBooks();
|
||||
if (this.drpBook.Items.Count > 0)
|
||||
{
|
||||
this.drpBook.SelectedIndex = 0;
|
||||
InitTree(this.drpBook.SelectedValue);
|
||||
}
|
||||
this.lblProgress.Text = "";
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 绑定书籍
|
||||
/// <summary>
|
||||
/// 绑定书籍下拉框。
|
||||
/// </summary>
|
||||
private void BindBooks()
|
||||
{
|
||||
this.drpBook.Items.Clear();
|
||||
foreach (PdfBook book in PdfBookService.GetBooks())
|
||||
{
|
||||
this.drpBook.Items.Add(new FineUIPro.ListItem(book.Title, book.BookId));
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 目录树
|
||||
/// <summary>
|
||||
/// 初始化目录树(按父章节/层级递归建树,支持多级目录)。
|
||||
/// </summary>
|
||||
private void InitTree(string bookId)
|
||||
{
|
||||
this.trCatalog.Nodes.Clear();
|
||||
this.trCatalog.SelectedNodeID = "";
|
||||
var chapters = PdfBookService.GetChapters(bookId);
|
||||
|
||||
// 1) 先为每个章节创建节点
|
||||
var nodeMap = new Dictionary<string, FineUIPro.TreeNode>();
|
||||
foreach (PdfChapter c in chapters)
|
||||
{
|
||||
var node = new FineUIPro.TreeNode
|
||||
{
|
||||
Text = c.Title,
|
||||
NodeID = c.ChapterId,
|
||||
CommandName = "chapter",
|
||||
CommandArgument = c.ChapterId,
|
||||
ToolTip = c.PageStart > 0 ? ("第" + c.PageStart + " - " + c.PageEnd + " 页") : "",
|
||||
EnableClickEvent = true,
|
||||
Expanded = true // 页面默认全部展开
|
||||
};
|
||||
nodeMap[c.ChapterId] = node;
|
||||
}
|
||||
|
||||
// 2) 按父章节挂接,没有父级(或父级不在列表)的作为顶级
|
||||
var roots = new List<FineUIPro.TreeNode>();
|
||||
foreach (PdfChapter c in chapters)
|
||||
{
|
||||
var node = nodeMap[c.ChapterId];
|
||||
if (!string.IsNullOrWhiteSpace(c.ParentChapterId) && nodeMap.ContainsKey(c.ParentChapterId))
|
||||
{
|
||||
nodeMap[c.ParentChapterId].Nodes.Add(node);
|
||||
}
|
||||
else
|
||||
{
|
||||
roots.Add(node);
|
||||
}
|
||||
}
|
||||
|
||||
// 3) 顶级节点加入树
|
||||
foreach (var r in roots)
|
||||
this.trCatalog.Nodes.Add(r);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 下拉切换
|
||||
/// <summary>
|
||||
/// 切换书籍。
|
||||
/// </summary>
|
||||
protected void drpBook_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
InitTree(this.drpBook.SelectedValue);
|
||||
this.htmlContent.Text = "";
|
||||
this.hfCurrentChapterId.Text = "";
|
||||
this.lblProgress.Text = "";
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 目录点击 → 加载章节内容
|
||||
/// <summary>
|
||||
/// 点击目录节点,把章节富文本内容加载到编辑器。
|
||||
/// 所有章节(含带子章节的目录章节)均可编辑自身正文,点击即加载。
|
||||
/// </summary>
|
||||
protected void trCatalog_NodeCommand(object sender, FineUIPro.TreeCommandEventArgs e)
|
||||
{
|
||||
if (e.Node == null)
|
||||
return;
|
||||
|
||||
string chapterId = e.Node.CommandArgument;
|
||||
if (string.IsNullOrWhiteSpace(chapterId))
|
||||
chapterId = e.Node.NodeID;
|
||||
|
||||
PdfChapterDetail detail = PdfBookService.GetChapterContent(chapterId);
|
||||
this.htmlContent.Text = detail == null ? "" : (detail.Content ?? "");
|
||||
this.hfCurrentChapterId.Text = chapterId;
|
||||
this.trCatalog.SelectedNodeID = e.Node.NodeID;
|
||||
this.lblProgress.Text = "正在编辑:" + (detail == null ? e.Node.Text : detail.Title);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 保存章节内容(富文本)
|
||||
/// <summary>
|
||||
/// 保存当前章节的富文本内容(HTML;本站上传图片引用自动转为 base64 内嵌存储)。
|
||||
/// </summary>
|
||||
protected void btnSaveContent_Click(object sender, EventArgs e)
|
||||
{
|
||||
string chapterId = this.hfCurrentChapterId.Text;
|
||||
if (string.IsNullOrWhiteSpace(chapterId))
|
||||
{
|
||||
FineUIPro.Alert.Show("请先在左侧目录选择章节。");
|
||||
return;
|
||||
}
|
||||
|
||||
// 本地上传图片转 base64 后入库,正文自包含(不依赖 upload 目录文件)
|
||||
string html = EmbedLocalImagesAsBase64(this.htmlContent.Text);
|
||||
|
||||
SQLHelper.ExecutSql("UPDATE dbo.Sys_PdfChapter SET Text=N'" + SqlEsc(html)
|
||||
+ "' WHERE ChapterId='" + SqlEsc(chapterId) + "'");
|
||||
this.lblProgress.Text = "内容已保存:" + DateTime.Now.ToString("HH:mm:ss");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 把 HTML 中指向本站 UMeditor 上传相关路径(/res/umeditor/net/..,含 ../../../upload 形态)的图片引用替换为 base64 内嵌。
|
||||
/// 已是 data: 的图片与外部 http(s) 图片原样保留;路径非图片扩展名或文件不存在时不做替换(回退原引用)。
|
||||
/// </summary>
|
||||
private static readonly Regex LocalUploadImgSrcRegex = new Regex(
|
||||
"src\\s*=\\s*([\"'])([^\"']*?/res/umeditor/net/[^\"']*?)\\1",
|
||||
RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
||||
|
||||
private string EmbedLocalImagesAsBase64(string html)
|
||||
{
|
||||
if (string.IsNullOrEmpty(html) ||
|
||||
html.IndexOf("/res/umeditor/net/", StringComparison.OrdinalIgnoreCase) < 0)
|
||||
return html;
|
||||
|
||||
return LocalUploadImgSrcRegex.Replace(html, delegate(Match m)
|
||||
{
|
||||
string quote = m.Groups[1].Value;
|
||||
string raw = m.Groups[2].Value;
|
||||
int i = raw.IndexOf("/res/umeditor/net/", StringComparison.OrdinalIgnoreCase);
|
||||
if (i < 0)
|
||||
return m.Value;
|
||||
string virtualPath = raw.Substring(i);
|
||||
int q = virtualPath.IndexOf('?');
|
||||
if (q >= 0) virtualPath = virtualPath.Substring(0, q);
|
||||
|
||||
string extCheck = System.IO.Path.GetExtension(virtualPath).ToLowerInvariant();
|
||||
if (extCheck != ".png" && extCheck != ".jpg" && extCheck != ".jpeg" && extCheck != ".gif" && extCheck != ".bmp")
|
||||
return m.Value;
|
||||
|
||||
try
|
||||
{
|
||||
string physical = Server.MapPath(virtualPath);
|
||||
if (!System.IO.File.Exists(physical))
|
||||
return m.Value;
|
||||
byte[] bytes = System.IO.File.ReadAllBytes(physical);
|
||||
if (bytes.Length == 0)
|
||||
return m.Value;
|
||||
|
||||
string ext = System.IO.Path.GetExtension(physical).ToLowerInvariant();
|
||||
string mime = ext == ".png" ? "image/png"
|
||||
: ext == ".gif" ? "image/gif"
|
||||
: ext == ".bmp" ? "image/bmp"
|
||||
: "image/jpeg";
|
||||
return "src=" + quote + "data:" + mime + ";base64," + Convert.ToBase64String(bytes) + quote;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return m.Value;
|
||||
}
|
||||
});
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 书籍新增
|
||||
/// <summary>
|
||||
/// 打开新增书籍弹窗。
|
||||
/// </summary>
|
||||
protected void btnAddBook_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.txtBookTitle.Text = "";
|
||||
this.WindowBook.Hidden = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存新增书籍。
|
||||
/// </summary>
|
||||
protected void btnSaveBook_Click(object sender, EventArgs e)
|
||||
{
|
||||
string title = this.txtBookTitle.Text.Trim();
|
||||
if (title.Length == 0)
|
||||
{
|
||||
FineUIPro.Alert.Show("请输入书名。");
|
||||
return;
|
||||
}
|
||||
|
||||
string bookId = NewId("PB");
|
||||
SQLHelper.ExecutSql(
|
||||
"INSERT INTO dbo.Sys_PdfBook (BookId, Title, FilePath, TotalPages, IndexStatus, CreateUser, CreateTime) VALUES ('"
|
||||
+ SqlEsc(bookId) + "',N'" + SqlEsc(title) + "',NULL,0,2,N'test',GETDATE())");
|
||||
|
||||
this.WindowBook.Hidden = true;
|
||||
BindBooks();
|
||||
this.drpBook.SelectedValue = bookId;
|
||||
InitTree(bookId);
|
||||
this.htmlContent.Text = "";
|
||||
this.hfCurrentChapterId.Text = "";
|
||||
this.lblProgress.Text = "已新增书籍:《" + title + "》,请继续添加章节。";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 关闭新增书籍弹窗。
|
||||
/// </summary>
|
||||
protected void btnCloseBook_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.WindowBook.Hidden = true;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 章节新增/编辑/删除
|
||||
/// <summary>
|
||||
/// 打开新增章节弹窗(父级=目录树选中节点,未选中则为顶级章节)。
|
||||
/// </summary>
|
||||
protected void btnAddChapter_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.drpBook.SelectedValue))
|
||||
{
|
||||
FineUIPro.Alert.Show("请先新增/选择书籍。");
|
||||
return;
|
||||
}
|
||||
|
||||
this.hfEditChapterId.Text = "";
|
||||
this.txtChapterTitle.Text = "";
|
||||
string parentId = this.trCatalog.SelectedNodeID;
|
||||
this.lblParentChapter.Text = string.IsNullOrEmpty(parentId) ? "顶级章节" : "选中节点的子章节";
|
||||
this.WindowChapter.Title = "新增章节";
|
||||
this.WindowChapter.Hidden = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 打开编辑章节弹窗(修改选中章节名称)。
|
||||
/// </summary>
|
||||
protected void btnEditChapter_Click(object sender, EventArgs e)
|
||||
{
|
||||
string chapterId = this.trCatalog.SelectedNodeID;
|
||||
if (string.IsNullOrEmpty(chapterId))
|
||||
{
|
||||
FineUIPro.Alert.Show("请先在目录中选择要编辑的章节。");
|
||||
return;
|
||||
}
|
||||
|
||||
DataTable dt = SQLHelper.GetDataTableRunText(
|
||||
"SELECT ChapterTitle FROM dbo.Sys_PdfChapter WHERE ChapterId=@id",
|
||||
new[] { new SqlParameter("@id", chapterId) });
|
||||
if (dt == null || dt.Rows.Count == 0)
|
||||
{
|
||||
FineUIPro.Alert.Show("未找到该章节。");
|
||||
return;
|
||||
}
|
||||
|
||||
this.hfEditChapterId.Text = chapterId;
|
||||
this.txtChapterTitle.Text = dt.Rows[0]["ChapterTitle"].ToString();
|
||||
this.lblParentChapter.Text = "修改章节名称";
|
||||
this.WindowChapter.Title = "编辑章节";
|
||||
this.WindowChapter.Hidden = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存章节(新增:挂在选中节点下,层级=父级+1;编辑:仅改名)。
|
||||
/// 保存后保持选中刚保存的章节:叶子章节加载其内容,目录章节仅刷新选中、不动编辑器。
|
||||
/// </summary>
|
||||
protected void btnSaveChapter_Click(object sender, EventArgs e)
|
||||
{
|
||||
string title = this.txtChapterTitle.Text.Trim();
|
||||
if (title.Length == 0)
|
||||
{
|
||||
FineUIPro.Alert.Show("请输入章节名称。");
|
||||
return;
|
||||
}
|
||||
|
||||
string bookId = this.drpBook.SelectedValue;
|
||||
string affectedId;
|
||||
|
||||
if (this.hfEditChapterId.Text != "")
|
||||
{
|
||||
// 编辑:仅改名称
|
||||
affectedId = this.hfEditChapterId.Text;
|
||||
SQLHelper.ExecutSql("UPDATE dbo.Sys_PdfChapter SET ChapterTitle=N'" + SqlEsc(title)
|
||||
+ "' WHERE ChapterId='" + SqlEsc(affectedId) + "'");
|
||||
}
|
||||
else
|
||||
{
|
||||
// 新增:父级为目录树选中节点
|
||||
string parentId = this.trCatalog.SelectedNodeID;
|
||||
int level = 1;
|
||||
if (!string.IsNullOrEmpty(parentId))
|
||||
{
|
||||
int parentLevel = SQLHelper.GetIntValue(
|
||||
"SELECT ISNULL([Level],1) FROM dbo.Sys_PdfChapter WHERE ChapterId='" + SqlEsc(parentId) + "'");
|
||||
level = parentLevel + 1;
|
||||
}
|
||||
int sort = SQLHelper.GetIntValue(
|
||||
"SELECT ISNULL(MAX(SortNo),0) FROM dbo.Sys_PdfChapter WHERE BookId='" + SqlEsc(bookId) + "'") + 1;
|
||||
affectedId = NewId("CH");
|
||||
|
||||
SQLHelper.ExecutSql(
|
||||
"INSERT INTO dbo.Sys_PdfChapter (ChapterId, BookId, ParentChapterId, [Level], ChapterTitle, PageStart, PageEnd, Text, SortNo) VALUES ('"
|
||||
+ SqlEsc(affectedId) + "','" + SqlEsc(bookId) + "',"
|
||||
+ (string.IsNullOrEmpty(parentId) ? "NULL" : "'" + SqlEsc(parentId) + "'")
|
||||
+ "," + level + ",N'" + SqlEsc(title) + "',NULL,NULL,N''," + sort + ")");
|
||||
}
|
||||
|
||||
this.WindowChapter.Hidden = true;
|
||||
InitTree(bookId);
|
||||
|
||||
// 保持选中刚保存的章节并加载其正文(目录章节同样可编辑正文)
|
||||
this.trCatalog.SelectedNodeID = affectedId;
|
||||
PdfChapterDetail detail = PdfBookService.GetChapterContent(affectedId);
|
||||
this.htmlContent.Text = detail == null ? "" : (detail.Content ?? "");
|
||||
this.hfCurrentChapterId.Text = affectedId;
|
||||
this.lblProgress.Text = "章节已保存,正在编辑:" + (detail == null ? title : detail.Title);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除选中章节及其全部子章节。
|
||||
/// </summary>
|
||||
protected void btnDelChapter_Click(object sender, EventArgs e)
|
||||
{
|
||||
string chapterId = this.trCatalog.SelectedNodeID;
|
||||
if (string.IsNullOrEmpty(chapterId))
|
||||
{
|
||||
FineUIPro.Alert.Show("请先在目录中选择要删除的章节。");
|
||||
return;
|
||||
}
|
||||
|
||||
string bookId = this.drpBook.SelectedValue;
|
||||
var all = PdfBookService.GetChapters(bookId);
|
||||
|
||||
// 递归收集要删除的章节(自身+全部后代)
|
||||
var ids = new List<string> { chapterId };
|
||||
bool changed = true;
|
||||
while (changed)
|
||||
{
|
||||
changed = false;
|
||||
foreach (PdfChapter c in all)
|
||||
{
|
||||
if (!ids.Contains(c.ChapterId) && ids.Contains(c.ParentChapterId ?? ""))
|
||||
{
|
||||
ids.Add(c.ChapterId);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var sb = new StringBuilder();
|
||||
foreach (string id in ids)
|
||||
{
|
||||
if (sb.Length > 0)
|
||||
sb.Append(",");
|
||||
sb.Append("'").Append(id.Replace("'", "''")).Append("'");
|
||||
}
|
||||
SQLHelper.ExecutSql("DELETE FROM dbo.Sys_PdfChapter WHERE ChapterId IN (" + sb + ")");
|
||||
|
||||
InitTree(bookId);
|
||||
this.htmlContent.Text = "";
|
||||
this.hfCurrentChapterId.Text = "";
|
||||
this.lblProgress.Text = "章节已删除(含子章节 " + (ids.Count - 1) + " 个)。";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 关闭章节弹窗。
|
||||
/// </summary>
|
||||
protected void btnCloseChapter_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.WindowChapter.Hidden = true;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 工具
|
||||
/// <summary>SQL 字符串转义。</summary>
|
||||
private static string SqlEsc(string s)
|
||||
{
|
||||
return (s ?? "").Replace("'", "''");
|
||||
}
|
||||
|
||||
/// <summary>生成业务主键(前缀+时间+随机)。</summary>
|
||||
private static string NewId(string prefix)
|
||||
{
|
||||
return prefix + DateTime.Now.ToString("yyyyMMddHHmmss")
|
||||
+ Guid.NewGuid().ToString("N").Substring(0, 4);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,314 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.HSSE.PDFDOC
|
||||
{
|
||||
|
||||
|
||||
public partial class PdfBookView
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// hfCurrentChapterId 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.HiddenField hfCurrentChapterId;
|
||||
|
||||
/// <summary>
|
||||
/// hfEditChapterId 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.HiddenField hfEditChapterId;
|
||||
|
||||
/// <summary>
|
||||
/// Panel1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel1;
|
||||
|
||||
/// <summary>
|
||||
/// panelLeftRegion 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel panelLeftRegion;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// drpBook 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpBook;
|
||||
|
||||
/// <summary>
|
||||
/// btnAddBook 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnAddBook;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar3;
|
||||
|
||||
/// <summary>
|
||||
/// btnAddChapter 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnAddChapter;
|
||||
|
||||
/// <summary>
|
||||
/// btnEditChapter 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnEditChapter;
|
||||
|
||||
/// <summary>
|
||||
/// btnDelChapter 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnDelChapter;
|
||||
|
||||
/// <summary>
|
||||
/// trCatalog 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Tree trCatalog;
|
||||
|
||||
/// <summary>
|
||||
/// panelCenterRegion 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel panelCenterRegion;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar2;
|
||||
|
||||
/// <summary>
|
||||
/// btnSaveContent 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSaveContent;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarFill2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarFill ToolbarFill2;
|
||||
|
||||
/// <summary>
|
||||
/// lblProgress 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label lblProgress;
|
||||
|
||||
/// <summary>
|
||||
/// htmlContent 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.HtmlEditor htmlContent;
|
||||
|
||||
/// <summary>
|
||||
/// WindowBook 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window WindowBook;
|
||||
|
||||
/// <summary>
|
||||
/// formBook 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form formBook;
|
||||
|
||||
/// <summary>
|
||||
/// txtBookTitle 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtBookTitle;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarBook 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar ToolbarBook;
|
||||
|
||||
/// <summary>
|
||||
/// btnSaveBook 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSaveBook;
|
||||
|
||||
/// <summary>
|
||||
/// btnCloseBook 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnCloseBook;
|
||||
|
||||
/// <summary>
|
||||
/// WindowChapter 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window WindowChapter;
|
||||
|
||||
/// <summary>
|
||||
/// formChapter 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form formChapter;
|
||||
|
||||
/// <summary>
|
||||
/// txtChapterTitle 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtChapterTitle;
|
||||
|
||||
/// <summary>
|
||||
/// lblParentChapter 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label lblParentChapter;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarChapter 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar ToolbarChapter;
|
||||
|
||||
/// <summary>
|
||||
/// btnSaveChapter 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSaveChapter;
|
||||
|
||||
/// <summary>
|
||||
/// btnCloseChapter 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnCloseChapter;
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,7 @@
|
||||
<TreeNode id="9C26BF2A-091D-4AC3-8678-334DE4E1CED7" Text="项目安全检查项" EnText="项目安全检查项" NavigateUrl="HSSE/Technique/CheckItemSet.aspx"></TreeNode>
|
||||
<TreeNode id="D11BFC83-BE64-457D-B8FA-11C37D35CD72" Text="应急预案" EnText="应急预案" NavigateUrl="HSSE/Technique/Emergency.aspx"></TreeNode>
|
||||
<TreeNode id="3E2F2FFD-ED2E-4914-8370-D97A68398814" Text="施工方案" EnText="施工方案" NavigateUrl="HSSE/Technique/SpecialScheme.aspx"></TreeNode>
|
||||
<TreeNode id="3BF92C894AD64523B7C2627F1BF25122" Text="安全标准" EnText="安全标准" NavigateUrl="HSSE/PDFDOC/PdfBookView.aspx"></TreeNode>
|
||||
<TreeNode id="8E3A5EDC-62CA-4F64-A4E7-CD3D473A6201" Text="防护标准" EnText="防护标准" NavigateUrl="HSSE/Technique/ProtectionStandards.aspx"></TreeNode>
|
||||
<TreeNode id="6D75EA6C-0E49-4B04-850B-930B628EE1DF" Text="安全职责" EnText="安全职责" NavigateUrl="HSSE/Technique/SafetyResponsibilities.aspx"></TreeNode>
|
||||
<TreeNode id="23ACEE2E-0E56-4136-9DFB-C971B3C4EA60" Text="队伍文明施工标准" EnText="队伍文明施工标准" NavigateUrl="HSSE/Technique/ConstructionStandards.aspx"></TreeNode>
|
||||
|
||||
@@ -2555,6 +2555,15 @@ namespace Model
|
||||
partial void InsertSys_parameter(Sys_parameter instance);
|
||||
partial void UpdateSys_parameter(Sys_parameter instance);
|
||||
partial void DeleteSys_parameter(Sys_parameter instance);
|
||||
partial void InsertSys_PdfBook(Sys_PdfBook instance);
|
||||
partial void UpdateSys_PdfBook(Sys_PdfBook instance);
|
||||
partial void DeleteSys_PdfBook(Sys_PdfBook instance);
|
||||
partial void InsertSys_PdfChapter(Sys_PdfChapter instance);
|
||||
partial void UpdateSys_PdfChapter(Sys_PdfChapter instance);
|
||||
partial void DeleteSys_PdfChapter(Sys_PdfChapter instance);
|
||||
partial void InsertSys_PdfPage(Sys_PdfPage instance);
|
||||
partial void UpdateSys_PdfPage(Sys_PdfPage instance);
|
||||
partial void DeleteSys_PdfPage(Sys_PdfPage instance);
|
||||
partial void InsertSys_Role(Sys_Role instance);
|
||||
partial void UpdateSys_Role(Sys_Role instance);
|
||||
partial void DeleteSys_Role(Sys_Role instance);
|
||||
@@ -9693,6 +9702,30 @@ namespace Model
|
||||
}
|
||||
}
|
||||
|
||||
public System.Data.Linq.Table<Sys_PdfBook> Sys_PdfBook
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.GetTable<Sys_PdfBook>();
|
||||
}
|
||||
}
|
||||
|
||||
public System.Data.Linq.Table<Sys_PdfChapter> Sys_PdfChapter
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.GetTable<Sys_PdfChapter>();
|
||||
}
|
||||
}
|
||||
|
||||
public System.Data.Linq.Table<Sys_PdfPage> Sys_PdfPage
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.GetTable<Sys_PdfPage>();
|
||||
}
|
||||
}
|
||||
|
||||
public System.Data.Linq.Table<Sys_Role> Sys_Role
|
||||
{
|
||||
get
|
||||
@@ -402209,6 +402242,882 @@ namespace Model
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Sys_PdfBook")]
|
||||
public partial class Sys_PdfBook : INotifyPropertyChanging, INotifyPropertyChanged
|
||||
{
|
||||
|
||||
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
|
||||
|
||||
private string _BookId;
|
||||
|
||||
private string _Title;
|
||||
|
||||
private string _FilePath;
|
||||
|
||||
private System.Nullable<int> _TotalPages;
|
||||
|
||||
private System.Nullable<int> _IndexStatus;
|
||||
|
||||
private System.Nullable<int> _IndexProgress;
|
||||
|
||||
private System.Nullable<int> _Dpi;
|
||||
|
||||
private string _FileHash;
|
||||
|
||||
private System.Nullable<System.DateTime> _LastIndexTime;
|
||||
|
||||
private string _CreateUser;
|
||||
|
||||
private System.Nullable<System.DateTime> _CreateTime;
|
||||
|
||||
private EntitySet<Sys_PdfChapter> _Sys_PdfChapter;
|
||||
|
||||
private EntitySet<Sys_PdfPage> _Sys_PdfPage;
|
||||
|
||||
#region 可扩展性方法定义
|
||||
partial void OnLoaded();
|
||||
partial void OnValidate(System.Data.Linq.ChangeAction action);
|
||||
partial void OnCreated();
|
||||
partial void OnBookIdChanging(string value);
|
||||
partial void OnBookIdChanged();
|
||||
partial void OnTitleChanging(string value);
|
||||
partial void OnTitleChanged();
|
||||
partial void OnFilePathChanging(string value);
|
||||
partial void OnFilePathChanged();
|
||||
partial void OnTotalPagesChanging(System.Nullable<int> value);
|
||||
partial void OnTotalPagesChanged();
|
||||
partial void OnIndexStatusChanging(System.Nullable<int> value);
|
||||
partial void OnIndexStatusChanged();
|
||||
partial void OnIndexProgressChanging(System.Nullable<int> value);
|
||||
partial void OnIndexProgressChanged();
|
||||
partial void OnDpiChanging(System.Nullable<int> value);
|
||||
partial void OnDpiChanged();
|
||||
partial void OnFileHashChanging(string value);
|
||||
partial void OnFileHashChanged();
|
||||
partial void OnLastIndexTimeChanging(System.Nullable<System.DateTime> value);
|
||||
partial void OnLastIndexTimeChanged();
|
||||
partial void OnCreateUserChanging(string value);
|
||||
partial void OnCreateUserChanged();
|
||||
partial void OnCreateTimeChanging(System.Nullable<System.DateTime> value);
|
||||
partial void OnCreateTimeChanged();
|
||||
#endregion
|
||||
|
||||
public Sys_PdfBook()
|
||||
{
|
||||
this._Sys_PdfChapter = new EntitySet<Sys_PdfChapter>(new Action<Sys_PdfChapter>(this.attach_Sys_PdfChapter), new Action<Sys_PdfChapter>(this.detach_Sys_PdfChapter));
|
||||
this._Sys_PdfPage = new EntitySet<Sys_PdfPage>(new Action<Sys_PdfPage>(this.attach_Sys_PdfPage), new Action<Sys_PdfPage>(this.detach_Sys_PdfPage));
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_BookId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)]
|
||||
public string BookId
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._BookId;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._BookId != value))
|
||||
{
|
||||
this.OnBookIdChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._BookId = value;
|
||||
this.SendPropertyChanged("BookId");
|
||||
this.OnBookIdChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Title", DbType="NVarChar(200)")]
|
||||
public string Title
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Title;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._Title != value))
|
||||
{
|
||||
this.OnTitleChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._Title = value;
|
||||
this.SendPropertyChanged("Title");
|
||||
this.OnTitleChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FilePath", DbType="NVarChar(500)")]
|
||||
public string FilePath
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._FilePath;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._FilePath != value))
|
||||
{
|
||||
this.OnFilePathChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._FilePath = value;
|
||||
this.SendPropertyChanged("FilePath");
|
||||
this.OnFilePathChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TotalPages", DbType="Int")]
|
||||
public System.Nullable<int> TotalPages
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._TotalPages;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._TotalPages != value))
|
||||
{
|
||||
this.OnTotalPagesChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._TotalPages = value;
|
||||
this.SendPropertyChanged("TotalPages");
|
||||
this.OnTotalPagesChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IndexStatus", DbType="Int")]
|
||||
public System.Nullable<int> IndexStatus
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._IndexStatus;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._IndexStatus != value))
|
||||
{
|
||||
this.OnIndexStatusChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._IndexStatus = value;
|
||||
this.SendPropertyChanged("IndexStatus");
|
||||
this.OnIndexStatusChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IndexProgress", DbType="Int")]
|
||||
public System.Nullable<int> IndexProgress
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._IndexProgress;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._IndexProgress != value))
|
||||
{
|
||||
this.OnIndexProgressChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._IndexProgress = value;
|
||||
this.SendPropertyChanged("IndexProgress");
|
||||
this.OnIndexProgressChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Dpi", DbType="Int")]
|
||||
public System.Nullable<int> Dpi
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Dpi;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._Dpi != value))
|
||||
{
|
||||
this.OnDpiChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._Dpi = value;
|
||||
this.SendPropertyChanged("Dpi");
|
||||
this.OnDpiChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FileHash", DbType="NVarChar(64)")]
|
||||
public string FileHash
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._FileHash;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._FileHash != value))
|
||||
{
|
||||
this.OnFileHashChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._FileHash = value;
|
||||
this.SendPropertyChanged("FileHash");
|
||||
this.OnFileHashChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_LastIndexTime", DbType="DateTime")]
|
||||
public System.Nullable<System.DateTime> LastIndexTime
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._LastIndexTime;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._LastIndexTime != value))
|
||||
{
|
||||
this.OnLastIndexTimeChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._LastIndexTime = value;
|
||||
this.SendPropertyChanged("LastIndexTime");
|
||||
this.OnLastIndexTimeChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CreateUser", DbType="NVarChar(50)")]
|
||||
public string CreateUser
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._CreateUser;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._CreateUser != value))
|
||||
{
|
||||
this.OnCreateUserChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._CreateUser = value;
|
||||
this.SendPropertyChanged("CreateUser");
|
||||
this.OnCreateUserChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CreateTime", DbType="DateTime")]
|
||||
public System.Nullable<System.DateTime> CreateTime
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._CreateTime;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._CreateTime != value))
|
||||
{
|
||||
this.OnCreateTimeChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._CreateTime = value;
|
||||
this.SendPropertyChanged("CreateTime");
|
||||
this.OnCreateTimeChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_PdfChapter_Book", Storage="_Sys_PdfChapter", ThisKey="BookId", OtherKey="BookId", DeleteRule="NO ACTION")]
|
||||
public EntitySet<Sys_PdfChapter> Sys_PdfChapter
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Sys_PdfChapter;
|
||||
}
|
||||
set
|
||||
{
|
||||
this._Sys_PdfChapter.Assign(value);
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_PdfPage_Book", Storage="_Sys_PdfPage", ThisKey="BookId", OtherKey="BookId", DeleteRule="NO ACTION")]
|
||||
public EntitySet<Sys_PdfPage> Sys_PdfPage
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Sys_PdfPage;
|
||||
}
|
||||
set
|
||||
{
|
||||
this._Sys_PdfPage.Assign(value);
|
||||
}
|
||||
}
|
||||
|
||||
public event PropertyChangingEventHandler PropertyChanging;
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
protected virtual void SendPropertyChanging()
|
||||
{
|
||||
if ((this.PropertyChanging != null))
|
||||
{
|
||||
this.PropertyChanging(this, emptyChangingEventArgs);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void SendPropertyChanged(String propertyName)
|
||||
{
|
||||
if ((this.PropertyChanged != null))
|
||||
{
|
||||
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
}
|
||||
|
||||
private void attach_Sys_PdfChapter(Sys_PdfChapter entity)
|
||||
{
|
||||
this.SendPropertyChanging();
|
||||
entity.Sys_PdfBook = this;
|
||||
}
|
||||
|
||||
private void detach_Sys_PdfChapter(Sys_PdfChapter entity)
|
||||
{
|
||||
this.SendPropertyChanging();
|
||||
entity.Sys_PdfBook = null;
|
||||
}
|
||||
|
||||
private void attach_Sys_PdfPage(Sys_PdfPage entity)
|
||||
{
|
||||
this.SendPropertyChanging();
|
||||
entity.Sys_PdfBook = this;
|
||||
}
|
||||
|
||||
private void detach_Sys_PdfPage(Sys_PdfPage entity)
|
||||
{
|
||||
this.SendPropertyChanging();
|
||||
entity.Sys_PdfBook = null;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Sys_PdfChapter")]
|
||||
public partial class Sys_PdfChapter : INotifyPropertyChanging, INotifyPropertyChanged
|
||||
{
|
||||
|
||||
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
|
||||
|
||||
private string _ChapterId;
|
||||
|
||||
private string _BookId;
|
||||
|
||||
private string _ParentChapterId;
|
||||
|
||||
private System.Nullable<int> _Level;
|
||||
|
||||
private string _ChapterTitle;
|
||||
|
||||
private System.Nullable<int> _PageStart;
|
||||
|
||||
private System.Nullable<int> _PageEnd;
|
||||
|
||||
private string _Text;
|
||||
|
||||
private System.Nullable<int> _SortNo;
|
||||
|
||||
private EntityRef<Sys_PdfBook> _Sys_PdfBook;
|
||||
|
||||
#region 可扩展性方法定义
|
||||
partial void OnLoaded();
|
||||
partial void OnValidate(System.Data.Linq.ChangeAction action);
|
||||
partial void OnCreated();
|
||||
partial void OnChapterIdChanging(string value);
|
||||
partial void OnChapterIdChanged();
|
||||
partial void OnBookIdChanging(string value);
|
||||
partial void OnBookIdChanged();
|
||||
partial void OnParentChapterIdChanging(string value);
|
||||
partial void OnParentChapterIdChanged();
|
||||
partial void OnLevelChanging(System.Nullable<int> value);
|
||||
partial void OnLevelChanged();
|
||||
partial void OnChapterTitleChanging(string value);
|
||||
partial void OnChapterTitleChanged();
|
||||
partial void OnPageStartChanging(System.Nullable<int> value);
|
||||
partial void OnPageStartChanged();
|
||||
partial void OnPageEndChanging(System.Nullable<int> value);
|
||||
partial void OnPageEndChanged();
|
||||
partial void OnTextChanging(string value);
|
||||
partial void OnTextChanged();
|
||||
partial void OnSortNoChanging(System.Nullable<int> value);
|
||||
partial void OnSortNoChanged();
|
||||
#endregion
|
||||
|
||||
public Sys_PdfChapter()
|
||||
{
|
||||
this._Sys_PdfBook = default(EntityRef<Sys_PdfBook>);
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ChapterId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)]
|
||||
public string ChapterId
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._ChapterId;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._ChapterId != value))
|
||||
{
|
||||
this.OnChapterIdChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._ChapterId = value;
|
||||
this.SendPropertyChanged("ChapterId");
|
||||
this.OnChapterIdChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_BookId", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
|
||||
public string BookId
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._BookId;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._BookId != value))
|
||||
{
|
||||
if (this._Sys_PdfBook.HasLoadedOrAssignedValue)
|
||||
{
|
||||
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
|
||||
}
|
||||
this.OnBookIdChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._BookId = value;
|
||||
this.SendPropertyChanged("BookId");
|
||||
this.OnBookIdChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ParentChapterId", DbType="NVarChar(50)")]
|
||||
public string ParentChapterId
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._ParentChapterId;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._ParentChapterId != value))
|
||||
{
|
||||
this.OnParentChapterIdChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._ParentChapterId = value;
|
||||
this.SendPropertyChanged("ParentChapterId");
|
||||
this.OnParentChapterIdChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Level", DbType="Int")]
|
||||
public System.Nullable<int> Level
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Level;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._Level != value))
|
||||
{
|
||||
this.OnLevelChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._Level = value;
|
||||
this.SendPropertyChanged("Level");
|
||||
this.OnLevelChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ChapterTitle", DbType="NVarChar(200)")]
|
||||
public string ChapterTitle
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._ChapterTitle;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._ChapterTitle != value))
|
||||
{
|
||||
this.OnChapterTitleChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._ChapterTitle = value;
|
||||
this.SendPropertyChanged("ChapterTitle");
|
||||
this.OnChapterTitleChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PageStart", DbType="Int")]
|
||||
public System.Nullable<int> PageStart
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._PageStart;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._PageStart != value))
|
||||
{
|
||||
this.OnPageStartChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._PageStart = value;
|
||||
this.SendPropertyChanged("PageStart");
|
||||
this.OnPageStartChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PageEnd", DbType="Int")]
|
||||
public System.Nullable<int> PageEnd
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._PageEnd;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._PageEnd != value))
|
||||
{
|
||||
this.OnPageEndChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._PageEnd = value;
|
||||
this.SendPropertyChanged("PageEnd");
|
||||
this.OnPageEndChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Text", DbType="NVarChar(MAX)", UpdateCheck=UpdateCheck.Never)]
|
||||
public string Text
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._Text != value))
|
||||
{
|
||||
this.OnTextChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._Text = value;
|
||||
this.SendPropertyChanged("Text");
|
||||
this.OnTextChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SortNo", DbType="Int")]
|
||||
public System.Nullable<int> SortNo
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._SortNo;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._SortNo != value))
|
||||
{
|
||||
this.OnSortNoChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._SortNo = value;
|
||||
this.SendPropertyChanged("SortNo");
|
||||
this.OnSortNoChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_PdfChapter_Book", Storage="_Sys_PdfBook", ThisKey="BookId", OtherKey="BookId", IsForeignKey=true)]
|
||||
public Sys_PdfBook Sys_PdfBook
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Sys_PdfBook.Entity;
|
||||
}
|
||||
set
|
||||
{
|
||||
Sys_PdfBook previousValue = this._Sys_PdfBook.Entity;
|
||||
if (((previousValue != value)
|
||||
|| (this._Sys_PdfBook.HasLoadedOrAssignedValue == false)))
|
||||
{
|
||||
this.SendPropertyChanging();
|
||||
if ((previousValue != null))
|
||||
{
|
||||
this._Sys_PdfBook.Entity = null;
|
||||
previousValue.Sys_PdfChapter.Remove(this);
|
||||
}
|
||||
this._Sys_PdfBook.Entity = value;
|
||||
if ((value != null))
|
||||
{
|
||||
value.Sys_PdfChapter.Add(this);
|
||||
this._BookId = value.BookId;
|
||||
}
|
||||
else
|
||||
{
|
||||
this._BookId = default(string);
|
||||
}
|
||||
this.SendPropertyChanged("Sys_PdfBook");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public event PropertyChangingEventHandler PropertyChanging;
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
protected virtual void SendPropertyChanging()
|
||||
{
|
||||
if ((this.PropertyChanging != null))
|
||||
{
|
||||
this.PropertyChanging(this, emptyChangingEventArgs);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void SendPropertyChanged(String propertyName)
|
||||
{
|
||||
if ((this.PropertyChanged != null))
|
||||
{
|
||||
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Sys_PdfPage")]
|
||||
public partial class Sys_PdfPage : INotifyPropertyChanging, INotifyPropertyChanged
|
||||
{
|
||||
|
||||
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
|
||||
|
||||
private string _PageId;
|
||||
|
||||
private string _BookId;
|
||||
|
||||
private System.Nullable<int> _PageNo;
|
||||
|
||||
private string _Text;
|
||||
|
||||
private System.Nullable<int> _OcrStatus;
|
||||
|
||||
private System.Nullable<int> _RetryCount;
|
||||
|
||||
private EntityRef<Sys_PdfBook> _Sys_PdfBook;
|
||||
|
||||
#region 可扩展性方法定义
|
||||
partial void OnLoaded();
|
||||
partial void OnValidate(System.Data.Linq.ChangeAction action);
|
||||
partial void OnCreated();
|
||||
partial void OnPageIdChanging(string value);
|
||||
partial void OnPageIdChanged();
|
||||
partial void OnBookIdChanging(string value);
|
||||
partial void OnBookIdChanged();
|
||||
partial void OnPageNoChanging(System.Nullable<int> value);
|
||||
partial void OnPageNoChanged();
|
||||
partial void OnTextChanging(string value);
|
||||
partial void OnTextChanged();
|
||||
partial void OnOcrStatusChanging(System.Nullable<int> value);
|
||||
partial void OnOcrStatusChanged();
|
||||
partial void OnRetryCountChanging(System.Nullable<int> value);
|
||||
partial void OnRetryCountChanged();
|
||||
#endregion
|
||||
|
||||
public Sys_PdfPage()
|
||||
{
|
||||
this._Sys_PdfBook = default(EntityRef<Sys_PdfBook>);
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PageId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)]
|
||||
public string PageId
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._PageId;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._PageId != value))
|
||||
{
|
||||
this.OnPageIdChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._PageId = value;
|
||||
this.SendPropertyChanged("PageId");
|
||||
this.OnPageIdChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_BookId", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
|
||||
public string BookId
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._BookId;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._BookId != value))
|
||||
{
|
||||
if (this._Sys_PdfBook.HasLoadedOrAssignedValue)
|
||||
{
|
||||
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
|
||||
}
|
||||
this.OnBookIdChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._BookId = value;
|
||||
this.SendPropertyChanged("BookId");
|
||||
this.OnBookIdChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PageNo", DbType="Int")]
|
||||
public System.Nullable<int> PageNo
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._PageNo;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._PageNo != value))
|
||||
{
|
||||
this.OnPageNoChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._PageNo = value;
|
||||
this.SendPropertyChanged("PageNo");
|
||||
this.OnPageNoChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Text", DbType="NVarChar(MAX)", UpdateCheck=UpdateCheck.Never)]
|
||||
public string Text
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._Text != value))
|
||||
{
|
||||
this.OnTextChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._Text = value;
|
||||
this.SendPropertyChanged("Text");
|
||||
this.OnTextChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_OcrStatus", DbType="Int")]
|
||||
public System.Nullable<int> OcrStatus
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._OcrStatus;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._OcrStatus != value))
|
||||
{
|
||||
this.OnOcrStatusChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._OcrStatus = value;
|
||||
this.SendPropertyChanged("OcrStatus");
|
||||
this.OnOcrStatusChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RetryCount", DbType="Int")]
|
||||
public System.Nullable<int> RetryCount
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._RetryCount;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._RetryCount != value))
|
||||
{
|
||||
this.OnRetryCountChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._RetryCount = value;
|
||||
this.SendPropertyChanged("RetryCount");
|
||||
this.OnRetryCountChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_PdfPage_Book", Storage="_Sys_PdfBook", ThisKey="BookId", OtherKey="BookId", IsForeignKey=true)]
|
||||
public Sys_PdfBook Sys_PdfBook
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Sys_PdfBook.Entity;
|
||||
}
|
||||
set
|
||||
{
|
||||
Sys_PdfBook previousValue = this._Sys_PdfBook.Entity;
|
||||
if (((previousValue != value)
|
||||
|| (this._Sys_PdfBook.HasLoadedOrAssignedValue == false)))
|
||||
{
|
||||
this.SendPropertyChanging();
|
||||
if ((previousValue != null))
|
||||
{
|
||||
this._Sys_PdfBook.Entity = null;
|
||||
previousValue.Sys_PdfPage.Remove(this);
|
||||
}
|
||||
this._Sys_PdfBook.Entity = value;
|
||||
if ((value != null))
|
||||
{
|
||||
value.Sys_PdfPage.Add(this);
|
||||
this._BookId = value.BookId;
|
||||
}
|
||||
else
|
||||
{
|
||||
this._BookId = default(string);
|
||||
}
|
||||
this.SendPropertyChanged("Sys_PdfBook");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public event PropertyChangingEventHandler PropertyChanging;
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
protected virtual void SendPropertyChanging()
|
||||
{
|
||||
if ((this.PropertyChanging != null))
|
||||
{
|
||||
this.PropertyChanging(this, emptyChangingEventArgs);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void SendPropertyChanged(String propertyName)
|
||||
{
|
||||
if ((this.PropertyChanged != null))
|
||||
{
|
||||
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Sys_Role")]
|
||||
public partial class Sys_Role : INotifyPropertyChanging, INotifyPropertyChanged
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
|
||||
@@ -0,0 +1,258 @@
|
||||
using BLL;
|
||||
using System;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace WebAPI.Controllers.HSSE
|
||||
{
|
||||
/// <summary>
|
||||
/// PDF 书籍模块接口(对应 PC 页面 HSSE/PDFDOC/PdfBookView.aspx 的完整功能:多级章节目录 + 富文本正文维护)。
|
||||
/// 数据表:Sys_PdfBook / Sys_PdfChapter(目录层级 ParentChapterId+Level,正文为 UMeditor 富文本 HTML)。
|
||||
/// 路由:api/PdfBook/{action},响应统一包装 Model.ResponeData(code:1正常 0异常)。
|
||||
/// 鉴权:只读接口(getBooks/getChapterTree/getChapter/searchChapter)已加入权限过滤白名单,免登录;
|
||||
/// 维护接口(add*/edit*/delete*/save*)需登录(请求头 token=用户/人员Id 或 FormsAuth 会话)。
|
||||
/// </summary>
|
||||
public class PdfBookController : ApiController
|
||||
{
|
||||
#region 只读接口
|
||||
|
||||
/// <summary>获取书籍列表(含章节数,按登记时间升序)。</summary>
|
||||
public Model.ResponeData getBooks()
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = APIPdfBookService.GetBooks();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
return responeData;
|
||||
}
|
||||
|
||||
/// <summary>获取某本书的多级章节目录树(嵌套 Children)。</summary>
|
||||
/// <param name="bookId">书籍主键,必填。</param>
|
||||
public Model.ResponeData getChapterTree(string bookId)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = APIPdfBookService.GetChapterTree(bookId);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
return responeData;
|
||||
}
|
||||
|
||||
/// <summary>获取章节正文详情(含富文本 HTML 与纯文本)。</summary>
|
||||
/// <param name="chapterId">章节主键,必填。</param>
|
||||
public Model.ResponeData getChapter(string chapterId)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
var detail = APIPdfBookService.GetChapterDetail(chapterId);
|
||||
if (detail == null)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = "章节不存在或已被删除";
|
||||
}
|
||||
else
|
||||
{
|
||||
responeData.data = detail;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
return responeData;
|
||||
}
|
||||
|
||||
/// <summary>章节关键词检索(正文 HTML 先转纯文本再匹配,返回命中片段)。</summary>
|
||||
[HttpPost]
|
||||
public Model.ResponeData searchChapter([FromBody] SearchRequest request)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
if (request == null)
|
||||
throw new Exception("请求参数不能为空");
|
||||
responeData.data = APIPdfBookService.SearchChapter(request.keyword, request.bookId);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 维护接口(需登录)
|
||||
|
||||
/// <summary>新增书籍,返回新书籍 BookId。</summary>
|
||||
[HttpPost]
|
||||
public Model.ResponeData addBook([FromBody] AddBookRequest request)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
if (request == null)
|
||||
throw new Exception("请求参数不能为空");
|
||||
responeData.data = new { bookId = APIPdfBookService.AddBook(request.title, request.createUser) };
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
return responeData;
|
||||
}
|
||||
|
||||
/// <summary>新增章节(parentChapterId 为空=顶级章节),返回新章节 ChapterId。</summary>
|
||||
[HttpPost]
|
||||
public Model.ResponeData addChapter([FromBody] AddChapterRequest request)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
if (request == null)
|
||||
throw new Exception("请求参数不能为空");
|
||||
responeData.data = new
|
||||
{
|
||||
chapterId = APIPdfBookService.AddChapter(request.bookId, request.parentChapterId, request.chapterTitle, request.createUser)
|
||||
};
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
return responeData;
|
||||
}
|
||||
|
||||
/// <summary>编辑章节名称。</summary>
|
||||
[HttpPost]
|
||||
public Model.ResponeData editChapter([FromBody] EditChapterRequest request)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
if (request == null)
|
||||
throw new Exception("请求参数不能为空");
|
||||
APIPdfBookService.EditChapter(request.chapterId, request.chapterTitle);
|
||||
responeData.data = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
return responeData;
|
||||
}
|
||||
|
||||
/// <summary>删除章节及其全部子章节,data 返回删除的章节总数。</summary>
|
||||
[HttpPost]
|
||||
public Model.ResponeData deleteChapter([FromBody] DeleteChapterRequest request)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
if (request == null)
|
||||
throw new Exception("请求参数不能为空");
|
||||
responeData.data = new { deletedCount = APIPdfBookService.DeleteChapter(request.chapterId) };
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
return responeData;
|
||||
}
|
||||
|
||||
/// <summary>保存章节正文(富文本 HTML,同页面"保存内容")。</summary>
|
||||
[HttpPost]
|
||||
public Model.ResponeData saveContent([FromBody] SaveContentRequest request)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
if (request == null)
|
||||
throw new Exception("请求参数不能为空");
|
||||
APIPdfBookService.SaveContent(request.chapterId, request.content);
|
||||
responeData.data = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 请求模型
|
||||
/// <summary>章节关键词检索请求。</summary>
|
||||
public class SearchRequest
|
||||
{
|
||||
/// <summary>检索关键词,必填。</summary>
|
||||
public string keyword { get; set; }
|
||||
/// <summary>书籍主键;不传/为空则全库检索。</summary>
|
||||
public string bookId { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>新增书籍请求。</summary>
|
||||
public class AddBookRequest
|
||||
{
|
||||
/// <summary>书名,必填。</summary>
|
||||
public string title { get; set; }
|
||||
/// <summary>登记人(缺省 "api")。</summary>
|
||||
public string createUser { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>新增章节请求。</summary>
|
||||
public class AddChapterRequest
|
||||
{
|
||||
/// <summary>所属书籍主键,必填。</summary>
|
||||
public string bookId { get; set; }
|
||||
/// <summary>父章节主键;为空=顶级章节。</summary>
|
||||
public string parentChapterId { get; set; }
|
||||
/// <summary>章节名称,必填。</summary>
|
||||
public string chapterTitle { get; set; }
|
||||
/// <summary>登记人(预留)。</summary>
|
||||
public string createUser { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>编辑章节请求。</summary>
|
||||
public class EditChapterRequest
|
||||
{
|
||||
/// <summary>章节主键,必填。</summary>
|
||||
public string chapterId { get; set; }
|
||||
/// <summary>新章节名称,必填。</summary>
|
||||
public string chapterTitle { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>删除章节请求。</summary>
|
||||
public class DeleteChapterRequest
|
||||
{
|
||||
/// <summary>章节主键,必填(连同全部子章节一并删除)。</summary>
|
||||
public string chapterId { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>保存章节正文请求。</summary>
|
||||
public class SaveContentRequest
|
||||
{
|
||||
/// <summary>章节主键,必填。</summary>
|
||||
public string chapterId { get; set; }
|
||||
/// <summary>正文内容(UMeditor 富文本 HTML),可为空串。</summary>
|
||||
public string content { get; set; }
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -102,7 +102,7 @@ namespace WebAPI.Controllers
|
||||
try
|
||||
{
|
||||
string strSql = "SELECT cp.ProjectId,cp.InstallationId,zz.Installationname AS InstallationName,ghfs AS Ghfs,cp.MaterialID,MaterialName,specificationtype AS Specificationtype,MaterialQuality,standardspecification ,unit AS Unit," +
|
||||
"technicalconditions AS TechnicalConditions,SystemCode,rtrim( ltrim( TAreaMaterialMID ) ) AS AreaCode,0.000 AS bcckl,SUM ( Aquantity ) AS Aquantity,SUM ( Pquantity ) AS jh_quantity,SUM ( SQuantity ) AS dj_quantity,SUM ( HQuantity ) AS hj_quantity,SUM ( Pquantity ) - SUM ( OQuantity ) AS ck_quantity,SUM ( RQuantity ) AS tk_quantity,(SELECT SUM( SQuantity ) - SUM ( OQuantity ) + SUM ( RQuantity ) - SUM ( HQuantity ) FROM cl_w_comp WHERE cl_w_comp.MaterialID= cp.MaterialID AND cl_w_comp.InstallationId= cp.InstallationId AND cl_w_comp.ghfs= cp.ghfs ) AS kc_quantity,ROW_NUMBER ( ) OVER ( ORDER BY zz.InstallationCode,SystemCode ASC ) AS RowNum,0 AS xz,0 AS xh FROM cl_w_comp cp LEFT JOIN CL_B_Material mt ON mt.MaterialID= cp.MaterialID LEFT JOIN cl_b_Installation zz ON zz.InstallationId= cp.InstallationId GROUP BY cp.ProjectId,cp.InstallationId,zz.InstallationCode,zz.Installationname,ghfs,cp.MaterialID,MaterialName,specificationtype,MaterialQuality,standardspecification,unit,technicalconditions,SystemCode,TAreaMaterialMID HAVING ";
|
||||
"technicalconditions AS TechnicalConditions,SystemCode,rtrim( ltrim( TAreaMaterialMID ) ) AS AreaCode,0.000 AS bcckl,SUM ( Aquantity ) AS Aquantity,SUM ( Pquantity ) AS jh_quantity,SUM ( SQuantity ) AS dj_quantity,SUM ( HQuantity ) AS hj_quantity,(SUM ( Pquantity ) - SUM ( OQuantity ) + SUM(RQuantity))AS ck_quantity,SUM ( RQuantity ) AS tk_quantity,(SELECT SUM( SQuantity ) - SUM ( OQuantity ) + SUM ( RQuantity ) - SUM ( HQuantity ) FROM cl_w_comp WHERE cl_w_comp.MaterialID= cp.MaterialID AND cl_w_comp.InstallationId= cp.InstallationId AND cl_w_comp.ghfs= cp.ghfs ) AS kc_quantity,ROW_NUMBER ( ) OVER ( ORDER BY zz.InstallationCode,SystemCode ASC ) AS RowNum,0 AS xz,0 AS xh FROM cl_w_comp cp LEFT JOIN CL_B_Material mt ON mt.MaterialID= cp.MaterialID LEFT JOIN cl_b_Installation zz ON zz.InstallationId= cp.InstallationId GROUP BY cp.ProjectId,cp.InstallationId,zz.InstallationCode,zz.Installationname,ghfs,cp.MaterialID,MaterialName,specificationtype,MaterialQuality,standardspecification,unit,technicalconditions,SystemCode,TAreaMaterialMID HAVING ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
strSql += "cp.ProjectId= @ProjectId AND cp.installationid= @InstallationId AND TAreaMaterialMID = @area AND ghfs = @ghfs AND SystemCode = @code";
|
||||
listStr.Add(new SqlParameter("@ProjectId", ProjectId));
|
||||
|
||||
@@ -179,6 +179,11 @@ namespace WebAPI.Filter
|
||||
"Rectify*getRectifyList",
|
||||
"ImageRecognition*getImageContent",
|
||||
"QuantityManagement*dayInputList",
|
||||
// PDF 书籍模块只读接口(阅读/检索免登录,与 ProtectionStandards 等规范类只读接口一致;维护类接口不在白名单,需 token 登录)
|
||||
"PdfBook*getBooks",
|
||||
"PdfBook*getChapterTree",
|
||||
"PdfBook*getChapter",
|
||||
"PdfBook*searchChapter",
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
@@ -215,4 +220,4 @@ namespace WebAPI.Filter
|
||||
public static List<string> listeds = new List<string> {"Person*getPersonByProjectIdIdentityCard", "Person*getPersonAllData",
|
||||
"Person*getPersonInOutList", "Person*addToBlack", "Person*getPersonData", "SY*SaveRisk", "Person*SaveSitePerson", "Person*SaveAndUpdateSitePerson", "Unit*AddUnit", "SY*SaveEnvironmentProtection","Person*getAllPersonDataExchange","SY*SaveLicence", "SY*SavePromise", "SY*SaveDataBase", "SY*SaveMajorHazard", "SY*SaveHiddenDangers", "HazardRealTime*SaveHazardRealTime", "upload*attendance", "upload*person", "Person*getPersonDataExchange", "Person*getPersonInOut", "Person*getUpdatePersonExchangeTime", "CommenInfo*FileUpload" };
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -170,6 +170,7 @@
|
||||
<Compile Include="Controllers\HSSE\GoodsManageController.cs" />
|
||||
<Compile Include="Controllers\HSSE\HazardRealTimeController.cs" />
|
||||
<Compile Include="Controllers\HSSE\ImageRecognitionController.cs" />
|
||||
<Compile Include="Controllers\HSSE\PdfBookController.cs" />
|
||||
<Compile Include="Controllers\HSSE\MaterialController.cs" />
|
||||
<Compile Include="Controllers\HSSE\ProtectionStandardsController.cs" />
|
||||
<Compile Include="Controllers\HSSE\RectifyController.cs" />
|
||||
@@ -376,4 +377,4 @@
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target> -->
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user