河北专项检查和移动端

This commit is contained in:
2025-04-06 23:26:22 +08:00
parent 64c7be5db4
commit 8aba5b01bc
204 changed files with 41904 additions and 3226 deletions
+3 -1
View File
@@ -614,7 +614,9 @@ namespace BLL
var getDataLists = (from x in Funs.DB.ProjectData_TeamGroup
where x.ProjectId == projectId && (unitId == null || x.UnitId == unitId)
orderby x.TeamGroupCode
select new Model.BaseInfoItem { BaseInfoId = x.TeamGroupId, BaseInfoCode = x.TeamGroupCode, BaseInfoName = x.TeamGroupName }).ToList();
select new Model.BaseInfoItem { BaseInfoId = x.TeamGroupId, BaseInfoCode = x.TeamGroupCode, BaseInfoName = x.TeamGroupName, GroupLeaderId=x.GroupLeaderId,
GroupLeaderName= Funs.DB.SitePerson_Person.FirstOrDefault(p=>p.PersonId == x.GroupLeaderId).PersonName,
Remark = x.Remark }).ToList();
return getDataLists;
}
+18
View File
@@ -1,4 +1,5 @@
using EmitMapper;
using Model;
using System.Collections.Generic;
using System.Linq;
@@ -6,6 +7,23 @@ namespace BLL
{
public static class APIProjectService
{
#region
public static List<Model.ProjectItem> geProjects()
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
return (from x in db.Base_Project
select new Model.ProjectItem()
{
ProjectId = x.ProjectId,
ProjectName = x.ProjectName
}).ToList(); ;
}
}
#endregion
/// <summary>
/// 根据userId获取用户信息
/// </summary>
@@ -150,6 +150,42 @@ namespace BLL
}
#region
public static List<Model.HazardRegisterItem> getHazardRegisterByProjectIdStates(string projectId, string date)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
DateTime mdate = Funs.GetNewDateTimeOrNow(date);
var hazardRegisters = (from x in db.HSSE_Hazard_HazardRegister
//join y in db.Base_Project on x.ProjectId equals projectId
where x.ProjectId == projectId
&& x.CheckTime.Value.Year == mdate.Year
&& x.CheckTime.Value.Month == mdate.Month
&& x.CheckTime.Value.Day == mdate.Day
select new Model.HazardRegisterItem
{
HazardRegisterId = x.HazardRegisterId,
ProjectId = x.ProjectId,
ProjectName = db.Base_Project.First(p=>p.ProjectId == x.ProjectId).ProjectName,
States = x.States,
Place = x.Place,
CheckTime = x.CheckTime,
CheckManName = db.Sys_User.First(u => u.UserId == x.CheckManId).UserName,
RectifyName = x.RectifyName,
RegisterDef = x.RegisterDef,
RegisterTypesName = db.HSSE_Hazard_HazardRegisterTypes.First(T => x.RegisterTypesId == T.RegisterTypesId).RegisterTypesName,
Rectification = x.Rectification,
ResponsibilityUnitName = db.Base_Unit.First(U => x.ResponsibleUnit == U.UnitId).UnitName,
ResponsibilityManName = db.Sys_User.First(User => x.ResponsibleMan == User.UserId).UserName,
RectificationTime = x.RectificationTime,
Risk_Level = x.Risk_Level,
}).OrderBy(x => x.CheckTime).ToList();
return hazardRegisters;
}
}
#endregion
/// <summary>
/// 安全巡检
/// </summary>
+33
View File
@@ -653,6 +653,39 @@ namespace BLL
}
#endregion
#region ()
public static List<Model.MeetingItem> getClassMeetingList(string projectId, string meetingDate)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
List<Model.MeetingItem> getMeetItem = new List<Model.MeetingItem>();
DateTime mdate = Funs.GetNewDateTimeOrNow(meetingDate);
getMeetItem = (from x in db.Meeting_ClassMeeting
where x.ProjectId == projectId
&& x.ClassMeetingDate.Value.Year == mdate.Year && x.ClassMeetingDate.Value.Month == mdate.Month && x.ClassMeetingDate.Value.Day == mdate.Day
select new Model.MeetingItem
{
MeetingId = x.ClassMeetingId,
ProjectId = x.ProjectId,
UnitId = x.UnitId,
UnitName = db.Base_Unit.First(u => u.UnitId == x.UnitId).UnitName,
TeamGroupId = x.TeamGroupId,
TeamGroupName = db.ProjectData_TeamGroup.First(u => u.TeamGroupId == x.TeamGroupId).TeamGroupName,
MeetingCode = x.ClassMeetingCode,
MeetingName = x.ClassMeetingName,
CompileDate = string.Format("{0:yyyy-MM-dd HH:mm}", x.CompileDate),
MeetingHostManOther = x.MeetingHostManOther,
CompileManId = x.CompileMan,
CompileManName = db.Sys_User.First(u => u.UserId == x.CompileMan).UserName,
AttentPersonNum = x.AttentPersonNum ?? 0,
}).ToList();
return getMeetItem;
}
}
#endregion
#region
/// <summary>
/// 根据时间获取各单位班会情况
+1 -1
View File
@@ -949,7 +949,7 @@ namespace BLL
/// <summary>
/// 天辰单位id
/// </summary>
public const string UnitId_TCC = "b4f3d912-ca6d-440c-a8d7-bc6a5d5a1f84";
public const string UnitId_TCC = "d792cef6-1025-4e1e-ad86-4c76298fad83";
/// <summary>
/// 天辰
/// </summary>
+3 -3
View File
@@ -172,7 +172,7 @@ namespace BLL
string htmlStr = string.Empty;
if (!string.IsNullOrEmpty(path))
{
htmlStr = "<table runat='server' cellpadding='5' cellspacing='5' style=\"width: 100%\">";
htmlStr = "<div id=\"img\" runat='server' style=\"width: 100%;height:100%;display: flex;flex-direction: row;justify-content: flex-start;align-items: flex-start;flex-wrap: wrap;\">";
string[] arrStr = path.Split(new string[] { "," }, System.StringSplitOptions.RemoveEmptyEntries);
for (int i = 0; i < arrStr.Length; i++)
{
@@ -190,11 +190,11 @@ namespace BLL
string fileName = subUrl[subUrl.Count() - 1];
string newFileName = fileName.Substring(fileName.IndexOf("~") + 1);
htmlStr += "<tr><td style=\"width: 60%\" align=\"left\"><img width='100' height='100' src='" + url + "'></img><br/></td>";
htmlStr += "<img width='60' height='60' style=\"margin-right:6px;margin-bottom:6px;\" src='" + url + "'></img>";
}
}
htmlStr += "</table>";
htmlStr += "</div>";
}
return htmlStr;
@@ -1,10 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using Model;
using static BLL.SafetyResponsibilitiesService;
namespace BLL.OfficeCheck.Inspect
{
@@ -15,73 +11,179 @@ namespace BLL.OfficeCheck.Inspect
/// 添加安全专项检查
/// </summary>
/// <param name="Inspection"></param>
public static void AddInspection(Model.Inspect_Inspection Inspection)
public static Model.Inspect_Inspection SaveInspection(Model.Inspect_Inspection Inspection)
{
Model.SGGLDB db = Funs.DB;
int count = (from x in db.Inspect_Inspection where x.InspectType == "1" select x).Count();
if (Inspection.InspectionId == null)
{
Inspection.InspectionId = SQLHelper.GetNewID();
}
Model.Inspect_Inspection newInspection = new Model.Inspect_Inspection
{
InspectionId = Inspection.InspectionId,
InspectionCode = Inspection.InspectionCode,
InspectionCode = "1-"+count.ToString("D6"),
ProjectId = Inspection.ProjectId,
PersonResponsible = Inspection.PersonResponsible,
InspectTime = Inspection.InspectTime,
Description = Inspection.Description,
States = Inspection.States,
InspectMan = Inspection.InspectMan,
InspectType = Inspection.InspectType,
InspectItemSetId = Inspection.InspectItemSetId,
ProjectStates = Inspection.ProjectStates,
CreateMan = Inspection.CreateMan,
CreateTime = Inspection.CreateTime,
CreateTime = DateTime.Today,
CheckMan = Inspection.CheckMan,
PersonResponsible = Inspection.PersonResponsible,
InspectType = Inspection.InspectType,
ProblemTypeId = Inspection.ProblemTypeId,
ProblemTypeName = Inspection.ProblemTypeName,
Place = Inspection.Place,
};
db.Inspect_Inspection.InsertOnSubmit(newInspection);
db.SubmitChanges();
// ////增加一条编码记录
// BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.SafetyInspectionMenuId,
// Inspection.ProjectId, null, Inspection.InspectionId, new DateTime());
}
/// <summary>
/// 添加安全专项明细检查
/// </summary>
/// <param name="Inspection"></param>
public static void AddInspectionItem(Model.Inspect_InspectionItem InspectionItem)
return newInspection;
}
#region
public static void UpdateInspection(Model.Inspect_Inspection Inspection)
{
Model.SGGLDB db = Funs.DB;
Model.Inspect_Inspection newInspection =
db.Inspect_Inspection.FirstOrDefault(e => e.InspectionId == Inspection.InspectionId);
if (newInspection != null)
{
newInspection.States = Inspection.States;
db.SubmitChanges();
ClosedInspection(Inspection.InspectionId);
}
}
#endregion
#region ID获取专项信息
public static Object GetInspectionById(string InspectionId)
{
return (from x in Funs.DB.Inspect_Inspection
where x.InspectionId == InspectionId
select new
{
InspectionId = x.InspectionId,
InspectionCode = x.InspectionCode,
ProjectId = x.ProjectId,
ProjectName = (from y in Funs.DB.Base_Project where y.ProjectId == x.ProjectId select y).First().ProjectName,
Description = x.Description,
States = x.States,
PersonResponsible = x.PersonResponsible,
PersonResponsibleName = (from y in Funs.DB.Sys_User where y.UserId == x.PersonResponsible select y.UserName).FirstOrDefault(),
CreateTime = x.CreateTime,
CreateMan = x.CreateMan,
CheckMan = x.CheckMan,
CreateManName = (from y in Funs.DB.Sys_User where y.UserId == x.CreateMan select y.UserName).FirstOrDefault(),
ProblemTypeId = x.ProblemTypeId,
ProblemTypeName = x.ProblemTypeName,
Place = x.Place,
children = (from a in Funs.DB.Inspect_InspectionItem
where a.InspectionId == x.InspectionId
orderby a.CompileTime descending
select new
{
InspectionItemId = a.InspectionItemId,
InspectionId = a.InspectionId,
ProjectId = a.ProjectId,
BeforelUrl = a.BeforelUrl,
States = a.States,
CompileTime = a.CompileTime,
AfterUrl = a.AfterUrl,
RectificationDate = a.RectificationDate,
EvaluateResults = a.EvaluateResults,
WorkAreaName = a.WorkAreaName
}).ToList()
}).FirstOrDefault(e => e.InspectionId == InspectionId);
}
#endregion
/// <summary>
/// 添加安全专项子项检查
/// </summary>
/// <param name="Inspection"></param>
public static void SaveInspectionItem(Model.Inspect_InspectionItem InspectionItem)
{
Model.SGGLDB db = Funs.DB;
InspectionItem.InspectionItemId = SQLHelper.GetNewID();
Model.Inspect_InspectionItem newInspectionItem = new Model.Inspect_InspectionItem
{
InspectionItemId = InspectionItem.InspectionItemId,
InspectionId = InspectionItem.InspectionId,
InspectionItemCode = InspectionItem.InspectionItemCode,
ProblemDetial = InspectionItem.ProblemDetial,
ProjectId = InspectionItem.ProjectId,
InspectionDescribe = InspectionItem.InspectionDescribe,
PhotoUrl = InspectionItem.PhotoUrl,
VideoUrl = InspectionItem.VideoUrl,
ProblemTypeId = InspectionItem.ProblemTypeId,
BeforelUrl = InspectionItem.BeforelUrl,
EvaluateResults = InspectionItem.EvaluateResults,
TimeLimited = InspectionItem.TimeLimited,
RectificationDescription = InspectionItem.RectificationDescription,
RectificationResults = InspectionItem.RectificationResults,
States = InspectionItem.States,
CompileMan = InspectionItem.CompileMan,
CompileTime = DateTime.Now,
CreateMan = InspectionItem.CreateMan,
CompileTime = InspectionItem.CompileTime,
AfterUrl = InspectionItem.AfterUrl,
ResponsiblePersonId = InspectionItem.ResponsiblePersonId,
RectificationDate = InspectionItem.RectificationDate,
Level = InspectionItem.Level,
WorkAreaName = InspectionItem.WorkAreaName,
};
db.Inspect_InspectionItem.InsertOnSubmit(newInspectionItem);
db.SubmitChanges();
ClosedInspection(InspectionItem.InspectionId);
}
/// <summary>
/// 根据专项检查ID获取专项明细信息
/// </summary>
/// <param name="CheckSpecialName"></param>
/// <returns></returns>
public static Model.Inspect_InspectionItem GetInspectItemsById(string InspectionItemId)
#region
public static void ClosedInspection(string InspectionId)
{
return Funs.DB.Inspect_InspectionItem.FirstOrDefault(e => e.InspectionItemId == InspectionItemId);
int count = Funs.DB.Inspect_InspectionItem.Count(x=>x.InspectionId == InspectionId && x.States != "3");
if(count == 0)
{
Model.SGGLDB db = Funs.DB;
Model.Inspect_Inspection newInspection =
db.Inspect_Inspection.FirstOrDefault(e => e.InspectionId == InspectionId);
newInspection.States = "3";
db.SubmitChanges();
}
}
#endregion
#region
public static Object GetInspectItemsById(string InspectionItemId)
{
return (from x in Funs.DB.Inspect_InspectionItem
join y in Funs.DB.Inspect_Inspection on x.InspectionId equals y.InspectionId
//join b in Funs.DB.Technique_Rectify on x.ProblemTypeId equals b.RectifyId
where x.InspectionItemId == InspectionItemId
select new
{
InspectionItemId = x.InspectionItemId,
InspectionId = x.InspectionId,
ProjectId = x.ProjectId,
ProjectName = Funs.DB.Base_Project.FirstOrDefault(p => p.ProjectId == x.ProjectId).ProjectName,
CreateTime = x.CompileTime,
CreateMan = x.CreateMan,
CreateManName = Funs.DB.Sys_User.FirstOrDefault(u => u.UserId == x.CreateMan).UserName,
CheckMan = y.CheckMan,
EvaluateResults = x.EvaluateResults,
WorkAreaName = x.WorkAreaName,
States = x.States,
BeforelUrl = x.BeforelUrl,
RectificationResults = x.RectificationResults,
AfterUrl = x.AfterUrl,
RectificationDate = x.RectificationDate,
InspectionCode = y.InspectionCode,
Description = y.Description,
InspectType = y.InspectType,
ProblemTypeId = y.ProblemTypeId,
ProblemTypeName = y.ProblemTypeName,
Place = y.Place,
}
).FirstOrDefault(e => e.InspectionItemId == InspectionItemId);
}
#endregion
/// <summary>
/// 根据专项检查ID获取专项信息
@@ -93,27 +195,7 @@ namespace BLL.OfficeCheck.Inspect
return Funs.DB.Inspect_Inspection.FirstOrDefault(e => e.InspectionId == InspectionId);
}
/// <summary>
/// 修改安全专项检查
/// </summary>
/// <param name="Inspection"></param>
public static void UpdateInspection(Model.Inspect_Inspection Inspection)
{
Model.SGGLDB db = Funs.DB;
Model.Inspect_Inspection newInspection =
db.Inspect_Inspection.FirstOrDefault(e => e.InspectionId == Inspection.InspectionId);
if (newInspection != null)
{
newInspection.InspectionCode = Inspection.InspectionCode;
//newInspection.ProjectId = Inspection.ProjectId;
newInspection.PersonResponsible = Inspection.PersonResponsible;
newInspection.InspectTime = Inspection.InspectTime;
newInspection.Description = Inspection.Description;
newInspection.States = Inspection.States;
db.SubmitChanges();
}
}
/// <summary>
/// 修改安全专项检查状态信息
/// </summary>
@@ -141,19 +223,25 @@ namespace BLL.OfficeCheck.Inspect
db.Inspect_InspectionItem.FirstOrDefault(e => e.InspectionItemId == InspectionItem.InspectionItemId);
if (newInspectionItem != null)
{
newInspectionItem.InspectionItemCode = InspectionItem.InspectionItemCode;
//newInspection.ProjectId = Inspection.ProjectId;
newInspectionItem.InspectionDescribe = InspectionItem.InspectionDescribe;
newInspectionItem.PhotoUrl = InspectionItem.PhotoUrl;
newInspectionItem.VideoUrl = InspectionItem.VideoUrl;
newInspectionItem.InspectionItemId = InspectionItem.InspectionItemId;
newInspectionItem.InspectionId = InspectionItem.InspectionId;
newInspectionItem.EvaluateResults = InspectionItem.EvaluateResults;
newInspectionItem.TimeLimited = InspectionItem.TimeLimited;
newInspectionItem.RectificationDescription = InspectionItem.RectificationDescription;
newInspectionItem.BeforelUrl = InspectionItem.BeforelUrl;
newInspectionItem.States = InspectionItem.States;
newInspectionItem.RectificationResults = InspectionItem.RectificationResults;
newInspectionItem.AfterUrl = InspectionItem.AfterUrl;
newInspectionItem.AuditTime = InspectionItem.AuditTime;
newInspectionItem.AuditMan = InspectionItem.AuditMan;
newInspectionItem.BeforelUrl = InspectionItem.BeforelUrl;
newInspectionItem.RectificationResults = InspectionItem.RectificationResults;
newInspectionItem.States = InspectionItem.States;
newInspectionItem.CompileMan = InspectionItem.CompileMan;
newInspectionItem.CompileTime = InspectionItem.CompileTime;
newInspectionItem.ResponsiblePersonId = InspectionItem.ResponsiblePersonId;
newInspectionItem.RectificationDate = InspectionItem.RectificationDate;
newInspectionItem.WorkAreaName = InspectionItem.WorkAreaName;
db.SubmitChanges();
ClosedInspection(InspectionItem.InspectionId);
}
}
@@ -213,35 +301,29 @@ namespace BLL.OfficeCheck.Inspect
/// </summary>
/// <param name="SafetyResponsibilitiesId"></param>
/// <returns></returns>
public static List<InspectionDto> GetInspectionList(string ProjectId, string States, string PersonResponsible, int PageNumber, int PageSize)
public static List<InspectionDto> GetInspectionList(string ProjectId, string States, int PageNumber, int PageSize)
{
var getDataLists = (from x in Funs.DB.Inspect_Inspection
join user in Funs.DB.Sys_User on x.InspectMan equals user.UserId into userJoin1
from subUser1 in userJoin1.DefaultIfEmpty()
join user in Funs.DB.Sys_User on x.CreateMan equals user.UserId into userJoin2
from subUser2 in userJoin2.DefaultIfEmpty()
join user in Funs.DB.Sys_User on x.PersonResponsible equals user.UserId into userJoin3
from subUser3 in userJoin3.DefaultIfEmpty()
join p in Funs.DB.Base_Project on x.ProjectId equals p.ProjectId into project
from pro in project.DefaultIfEmpty()
select new InspectionDto
{
InspectionId = x.InspectionId,
InspectionCode = x.InspectionCode,
ProjectId = x.ProjectId,
ProjectName = pro.ProjectName,
ProjectName = Funs.DB.Base_Project.FirstOrDefault(p=>p.ProjectId == x.ProjectId).ProjectName,
PersonResponsible = x.PersonResponsible,
PersonResponsibleName = subUser3.UserName,
InspectTime = x.InspectTime,
PersonResponsibleName = Funs.DB.Sys_User.FirstOrDefault(u => u.UserId == x.PersonResponsible).UserName,
Description = x.Description,
States = x.States,
InspectMan = subUser1.UserName,
InspectManId = x.InspectMan,
InspectType = x.InspectType,
InspectItemSetId = x.InspectItemSetId,
CreateMan = subUser2.UserName,
CreateManName = Funs.DB.Sys_User.FirstOrDefault(u=>u.UserId == x.CreateMan).UserName,
CreateMan = x.CreateMan,
CreateTime = x.CreateTime,
CheckMan = x.CheckMan,
InspectType = x.InspectType,
ProblemTypeId = x.ProblemTypeId,
ProblemTypeName = x.ProblemTypeName,
Place = x.Place,
ChildsCount = Funs.DB.Inspect_InspectionItem.Count(itm=>itm.InspectionId == x.InspectionId).ToString()
});
if (!string.IsNullOrEmpty(ProjectId))
{
@@ -253,11 +335,6 @@ namespace BLL.OfficeCheck.Inspect
getDataLists = getDataLists.Where(q => q.States == States);
}
if (!string.IsNullOrEmpty(PersonResponsible))
{
getDataLists = getDataLists.Where(q => q.PersonResponsible == PersonResponsible);
}
if (PageNumber > 0 && PageSize > 0)
{
getDataLists = getDataLists.Skip((PageNumber - 1) * PageSize).Take(PageSize);
@@ -276,28 +353,26 @@ namespace BLL.OfficeCheck.Inspect
{
List<InspectionItemDto> getDataLists = (from x in Funs.DB.Inspect_InspectionItem
join user in Funs.DB.Sys_User on x.CompileMan equals user.UserId into userJoin1
from subUser1 in userJoin1.DefaultIfEmpty()
join p in Funs.DB.Base_Project on x.ProjectId equals p.ProjectId into project
from pro in project.DefaultIfEmpty()
where x.InspectionId == InspectionId
select new InspectionItemDto
{
InspectionItemId = x.InspectionItemId,
InspectionId = x.InspectionId,
InspectionItemCode = x.InspectionItemCode,
ProjectId = x.ProjectId,
ProjectName = pro.ProjectName,
InspectionDescribe = x.InspectionDescribe,
PhotoUrl = x.PhotoUrl,
VideoUrl = x.VideoUrl,
EvaluateResults = x.EvaluateResults,
TimeLimited = x.TimeLimited,
RectificationDescription = x.RectificationDescription,
RectificationResults = x.RectificationResults,
States = x.States,
CompileMan = subUser1.UserName,
CompileTime = x.CompileTime,
//InspectionItemId = x.InspectionItemId,
//InspectionId = x.InspectionId,
//InspectionItemCode = x.InspectionItemCode,
//ProjectId = x.ProjectId,
//ProjectName = pro.ProjectName,
//InspectionDescribe = x.InspectionDescribe,
//PhotoUrl = x.PhotoUrl,
//VideoUrl = x.VideoUrl,
//EvaluateResults = x.EvaluateResults,
//TimeLimited = x.TimeLimited,
//RectificationDescription = x.RectificationDescription,
//RectificationResults = x.RectificationResults,
//States = x.States,
//CompileMan = subUser1.UserName,
//CompileTime = x.CompileTime,
}).ToList();
if (PageNumber > 0 && PageSize > 0)
{
@@ -325,7 +400,6 @@ namespace BLL.OfficeCheck.Inspect
public class InspectionDto
{
public string InspectionId
{
get;
@@ -360,12 +434,6 @@ namespace BLL.OfficeCheck.Inspect
set;
}
public System.Nullable<System.DateTime> InspectTime
{
get;
set;
}
public string Description
{
get;
@@ -378,12 +446,6 @@ namespace BLL.OfficeCheck.Inspect
set;
}
public string InspectMan
{
get;
set;
}
public string InspectManId
{
get;
@@ -395,22 +457,36 @@ namespace BLL.OfficeCheck.Inspect
get;
set;
}
public string InspectItemSetId
{
get;
set;
}
public string CreateMan
{
get;
set;
}
public string CreateManName
{
get;
set;
}
public System.Nullable<System.DateTime> CreateTime
{
get;
set;
}
public string ProblemTypeId { get; set; }
public string ProblemTypeName { get; set; }
public string Place { get; set; }
public string CheckMan
{
get;
set;
}
public string ChildsCount
{
get;
set;
}
}