20230530集团看板数据来源页面添加

This commit is contained in:
2023-05-30 08:52:00 +08:00
parent 9c804196e7
commit f4b1c42fa9
118 changed files with 18934 additions and 137 deletions
+12
View File
@@ -402,6 +402,7 @@
<Compile Include="HSSE\Check\Check_CheckSpecialDetailService.cs" />
<Compile Include="HSSE\Check\Check_CheckSpecialService.cs" />
<Compile Include="HSSE\Check\Check_PauseNoticeService.cs" />
<Compile Include="HSSE\Check\Check_ProjectLeaderCheckService.cs" />
<Compile Include="HSSE\Check\IncentiveNoticeService.cs" />
<Compile Include="HSSE\Check\PunishNoticeService.cs" />
<Compile Include="HSSE\Check\RectifyNoticesService.cs" />
@@ -478,6 +479,7 @@
<Compile Include="HSSE\Meeting\AttendMeetingService.cs" />
<Compile Include="HSSE\Meeting\ClassMeetingService.cs" />
<Compile Include="HSSE\Meeting\MonthMeetingService.cs" />
<Compile Include="HSSE\Meeting\SafetyLeaderGroupMeetingService.cs" />
<Compile Include="HSSE\Meeting\SpecialMeetingService.cs" />
<Compile Include="HSSE\Meeting\WeekMeetingService.cs" />
<Compile Include="HSSE\CostGoods\ExpenseDetailService.cs" />
@@ -672,6 +674,8 @@
<Compile Include="ZHGL\DataSync\SYHSEData_HiddenDangerCheckService.cs" />
<Compile Include="ZHGL\DataSync\SYHSEData_RiskControlService.cs" />
<Compile Include="ZHGL\DataSync\SYHSEData_SYHSEService.cs" />
<Compile Include="ZHGL\Emergency\UnitDrillRecordListService.cs" />
<Compile Include="ZHGL\Emergency\UnitEmergencyListService.cs" />
<Compile Include="ZHGL\Environmental\ArchitectureReportItemService.cs" />
<Compile Include="ZHGL\Environmental\ArchitectureReportService.cs" />
<Compile Include="ZHGL\Environmental\ChemicalReportItemService.cs" />
@@ -699,6 +703,8 @@
<Compile Include="ZHGL\Information\SafetyQuarterlyReportService.cs" />
<Compile Include="ZHGL\Information\UrgeReportService.cs" />
<Compile Include="ZHGL\Information\WorkSummaryReportService.cs" />
<Compile Include="ZHGL\Meeting\CompanySafetyMeetingService.cs" />
<Compile Include="ZHGL\Meeting\CompanySpecialMeetingService.cs" />
<Compile Include="ZHGL\RealName\BasicDataService.cs" />
<Compile Include="ZHGL\RealName\CityService.cs" />
<Compile Include="ZHGL\RealName\CountryService.cs" />
@@ -706,6 +712,12 @@
<Compile Include="ZHGL\RealName\RealNameMonitorService.cs" />
<Compile Include="ZHGL\RealName\RealName_ProjectService.cs" />
<Compile Include="ZHGL\RealName\SynchroSetService.cs" />
<Compile Include="ZHGL\Supervise\SubUnitCheckRectifyItemService.cs" />
<Compile Include="ZHGL\Supervise\SubUnitCheckRectifyService.cs" />
<Compile Include="ZHGL\Supervise\SuperviseCheckRectifyItemService.cs" />
<Compile Include="ZHGL\Supervise\SuperviseCheckRectifyService.cs" />
<Compile Include="ZHGL\Supervise\SuperviseCheckReportItemService.cs" />
<Compile Include="ZHGL\Supervise\SuperviseCheckReportService.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Model\Model.csproj">
+4
View File
@@ -32,6 +32,8 @@ namespace BLL
CertificateId = certificate.CertificateId,
CertificateCode = certificate.CertificateCode,
CertificateName = certificate.CertificateName,
CertificateType = certificate.CertificateType,
IsRegisterHSSE = certificate.IsRegisterHSSE,
Remark = certificate.Remark
};
db.Base_Certificate.InsertOnSubmit(newCertificate);
@@ -50,6 +52,8 @@ namespace BLL
{
newCertificate.CertificateCode = certificate.CertificateCode;
newCertificate.CertificateName = certificate.CertificateName;
newCertificate.CertificateType = certificate.CertificateType;
newCertificate.IsRegisterHSSE = certificate.IsRegisterHSSE;
newCertificate.Remark = certificate.Remark;
db.SubmitChanges();
}
+37 -1
View File
@@ -789,11 +789,18 @@
/// </summary>
public const string CheckNoticeMenuId = "C502FC6D-DE43-4646-AE28-168D8C7BF4C0";
/// <summary>
/// 公司两级领导带班检查
/// </summary>
public const string ServerCheckTwolevelMenuId = "6CBF1000-5E3C-4FBD-A7EC-965765F6F52D";
/// <summary>
/// 发起检查
/// </summary>
public const string CheckInfoMenuId = "6090DD54-FE59-4011-92EE-9906C9BC69B6";
public const string Base_FactoryMenuId = "CD167198-1667-4552-9876-E768C2542C30";
/// <summary>
/// 实业
/// </summary>
@@ -907,6 +914,16 @@
/// </summary>
public const string ProjectEnergyReportMenuId = "9DE996D9-A2CF-40C8-86D3-6A472AB30E5D";
/// <summary>
/// HSSE应急预案管理清单
/// </summary>
public const string UnitEmergencyListMenuId = "D12C2412-E12A-4F78-9AEF-1EE8AC84A561";
/// <summary>
/// 应急演练
/// </summary>
public const string UnitDrillRecordListMenuId = "172F25E0-F5E2-42E3-AD67-AC824D4E0FBB";
#region
/// <summary>
/// 单位设置
@@ -1686,6 +1703,18 @@
/// </summary>
public const string ServerTestRankingMenuId = "19FB0C6D-E2CA-4352-B635-060347D45C4A";
#endregion
#region
/// <summary>
/// 企业安委会
/// </summary>
public const string CompanySafetyMeetingMenuId = "B911B4F8-DDFD-4F37-9EAC-EB104F753432";
/// <summary>
/// 企业专题会
/// </summary>
public const string CompanySpecialMeetingMenuId = "2497EF13-C052-4228-B388-EBC5C18963BC";
#endregion
#endregion
#region
@@ -1734,7 +1763,6 @@
#region
#region
/// <summary>
/// 安全组织机构
@@ -2123,6 +2151,10 @@
/// 联系单
/// </summary>
public const string ProjectContactListMenuId = "F057C207-4549-48AE-B838-A1920E5709D8";
/// <summary>
/// 领导带班检查
/// </summary>
public const string ProjectLeaderCheckMenuId = "355265DE-901A-4110-B934-B4DA067C4334";
#endregion
#region APP检查管理
@@ -2209,6 +2241,10 @@
/// 班前会
/// </summary>
public const string ProjectClassMeetingMenuId = "F8ADCDBC-AAAD-4884-9935-2B63562E4779";
/// <summary>
/// 安全领导小组会议
/// </summary>
public const string ProjectSafetyLeaderGroupMeetingMenuId = "DFB56743-17BA-40BA-82EA-FCB9B0DBFAFF";
#endregion
#region
@@ -43,6 +43,7 @@ namespace BLL
FileContent = accidentPersonRecord.FileContent,
CompileMan = accidentPersonRecord.CompileMan,
CompileDate = accidentPersonRecord.CompileDate,
IsAttempt = accidentPersonRecord.IsAttempt,
States = accidentPersonRecord.States
};
db.Accident_AccidentPersonRecord.InsertOnSubmit(newAccidentPersonRecord);
@@ -73,6 +74,7 @@ namespace BLL
newAccidentPersonRecord.FileContent = accidentPersonRecord.FileContent;
newAccidentPersonRecord.CompileMan = accidentPersonRecord.CompileMan;
newAccidentPersonRecord.CompileDate = accidentPersonRecord.CompileDate;
newAccidentPersonRecord.IsAttempt = accidentPersonRecord.IsAttempt;
newAccidentPersonRecord.States = accidentPersonRecord.States;
db.SubmitChanges();
}
@@ -0,0 +1,214 @@
using FineUIPro;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web.UI.WebControls;
namespace BLL
{
/// <summary>
/// 领导带班检查
/// </summary>
public static class Check_ProjectLeaderCheckService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取领导带班检查
/// </summary>
/// <param name="ProjectLeaderCheckId"></param>
/// <returns></returns>
public static Model.Check_ProjectLeaderCheck GetProjectLeaderCheckById(string ProjectLeaderCheckId)
{
return Funs.DB.Check_ProjectLeaderCheck.FirstOrDefault(e => e.ProjectLeaderCheckId == ProjectLeaderCheckId);
}
#region
/// <summary>
/// 记录数
/// </summary>
public static int count
{
get;
set;
}
/// <summary>
/// 定义变量
/// </summary>
private static IQueryable<Model.Check_ProjectLeaderCheck> getDataLists = from x in db.Check_ProjectLeaderCheck
select x;
/// <summary>
/// 数据列表
/// </summary>
/// <param name="unitId"></param>
/// <param name="Grid1"></param>
/// <returns></returns>
public static IEnumerable getListData(string projectId, string startTime, string endTime, Grid Grid1)
{
IQueryable<Model.Check_ProjectLeaderCheck> getDataList = getDataLists;
if (!string.IsNullOrEmpty(projectId))
{
getDataList = getDataList.Where(x => x.ProjectId == projectId);
}
if (!string.IsNullOrEmpty(startTime))
{
DateTime? startTimeD = Funs.GetNewDateTime(startTime);
if (startTimeD.HasValue)
{
getDataList = getDataList.Where(x => x.CheckDate >= startTimeD);
}
}
if (!string.IsNullOrEmpty(endTime))
{
DateTime? endTimeD = Funs.GetNewDateTime(endTime);
if (endTimeD.HasValue)
{
getDataList = getDataList.Where(x => x.CheckDate <= endTimeD);
}
}
count = getDataList.Count();
if (count == 0)
{
return null;
}
getDataList = SortConditionHelper.SortingAndPaging(getDataList, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
return from x in getDataList
join y in db.Base_Project on x.ProjectId equals y.ProjectId
into ps
from y in ps.DefaultIfEmpty()
select new
{
x.ProjectLeaderCheckId,
x.ProjectId,
db.Base_Project.First(u => u.ProjectId == x.ProjectId).ProjectName,
x.CheckCode,
x.UnitIds,
x.LeaderIds,
x.LeaderNames,
x.QuestionDef,
x.CheckDate,
x.IsHoldMeet,
IsHoldMeetName = x.IsHoldMeet == true ? "是" : "否",
x.Requirement,
};
}
#endregion
/// <summary>
/// 根据日期获取领导带班检查集合
/// </summary>
/// <param name="startTime">开始时间</param>
/// <param name="endTime">结束时间</param>
/// <param name="projectId">项目号</param>
/// <returns>领导带班检查集合</returns>
public static List<Model.Check_ProjectLeaderCheck> GetProjectLeaderCheckListsByDate(DateTime startTime, DateTime endTime, string projectId)
{
return (from x in Funs.DB.Check_ProjectLeaderCheck where x.CheckDate >= startTime && x.CheckDate <= endTime && x.ProjectId == projectId orderby x.CheckDate select x).ToList();
}
/// <summary>
/// 根据时间段获取HSE领导带班检查集合
/// </summary>
/// <param name="startTime">开始时间</param>
/// <param name="endTime">结束时间</param>
/// <param name="projectId">项目Id</param>
/// <returns>时间段内的HSE领导带班检查集合</returns>
public static int GetCountByDate(DateTime startTime, DateTime endTime, string projectId)
{
return (from x in Funs.DB.Check_ProjectLeaderCheck where x.CheckDate >= startTime && x.CheckDate <= endTime && x.ProjectId == projectId select x).Count();
}
/// <summary>
/// 添加领导带班检查
/// </summary>
/// <param name="ProjectLeaderCheck"></param>
public static void AddProjectLeaderCheck(Model.Check_ProjectLeaderCheck ProjectLeaderCheck)
{
Model.SGGLDB db = Funs.DB;
Model.Check_ProjectLeaderCheck newProjectLeaderCheck = new Model.Check_ProjectLeaderCheck
{
ProjectLeaderCheckId = ProjectLeaderCheck.ProjectLeaderCheckId,
ProjectId = ProjectLeaderCheck.ProjectId,
UnitIds = ProjectLeaderCheck.UnitIds,
CheckCode = ProjectLeaderCheck.CheckCode,
LeaderIds = ProjectLeaderCheck.LeaderIds,
CheckDate = ProjectLeaderCheck.CheckDate,
QuestionDef = ProjectLeaderCheck.QuestionDef,
IsHoldMeet = ProjectLeaderCheck.IsHoldMeet,
Requirement = ProjectLeaderCheck.Requirement,
LeaderNames = ProjectLeaderCheck.LeaderNames,
CompileMan = ProjectLeaderCheck.CompileMan,
CompileDate = ProjectLeaderCheck.CompileDate,
};
db.Check_ProjectLeaderCheck.InsertOnSubmit(newProjectLeaderCheck);
db.SubmitChanges();
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ProjectLeaderCheckMenuId, ProjectLeaderCheck.ProjectId, null, ProjectLeaderCheck.ProjectLeaderCheckId, ProjectLeaderCheck.CheckDate);
}
/// <summary>
/// 修改领导带班检查
/// </summary>
/// <param name="ProjectLeaderCheck"></param>
public static void UpdateProjectLeaderCheck(Model.Check_ProjectLeaderCheck ProjectLeaderCheck)
{
Model.SGGLDB db = Funs.DB;
Model.Check_ProjectLeaderCheck newProjectLeaderCheck = db.Check_ProjectLeaderCheck.FirstOrDefault(e => e.ProjectLeaderCheckId == ProjectLeaderCheck.ProjectLeaderCheckId);
if (newProjectLeaderCheck != null)
{
newProjectLeaderCheck.UnitIds = ProjectLeaderCheck.UnitIds;
newProjectLeaderCheck.CheckCode = ProjectLeaderCheck.CheckCode;
newProjectLeaderCheck.LeaderIds = ProjectLeaderCheck.LeaderIds;
newProjectLeaderCheck.CheckDate = ProjectLeaderCheck.CheckDate;
newProjectLeaderCheck.QuestionDef = ProjectLeaderCheck.QuestionDef;
newProjectLeaderCheck.IsHoldMeet = ProjectLeaderCheck.IsHoldMeet;
newProjectLeaderCheck.Requirement = ProjectLeaderCheck.Requirement;
newProjectLeaderCheck.LeaderNames = ProjectLeaderCheck.LeaderNames;
newProjectLeaderCheck.CompileMan = ProjectLeaderCheck.CompileMan;
newProjectLeaderCheck.CompileDate = ProjectLeaderCheck.CompileDate;
db.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除领导带班检查
/// </summary>
/// <param name="ProjectLeaderCheckId"></param>
public static void DeleteProjectLeaderCheckById(string ProjectLeaderCheckId)
{
Model.SGGLDB db = Funs.DB;
Model.Check_ProjectLeaderCheck ProjectLeaderCheck = db.Check_ProjectLeaderCheck.FirstOrDefault(e => e.ProjectLeaderCheckId == ProjectLeaderCheckId);
if (ProjectLeaderCheck != null)
{
CodeRecordsService.DeleteCodeRecordsByDataId(ProjectLeaderCheckId);
////删除附件表
BLL.CommonService.DeleteAttachFileById(ProjectLeaderCheckId);
db.Check_ProjectLeaderCheck.DeleteOnSubmit(ProjectLeaderCheck);
db.SubmitChanges();
}
}
public static string getLeaderName(object ProjectLeaderCheckId)
{
string name = string.Empty;
if (ProjectLeaderCheckId != null)
{
var getData = Check_ProjectLeaderCheckService.GetProjectLeaderCheckById(ProjectLeaderCheckId.ToString());
if (getData != null)
{
if (!string.IsNullOrEmpty(getData.LeaderIds))
{
name = Person_PersonsService.getPersonsNamesPersonIds(getData.LeaderIds);
}
if (!string.IsNullOrEmpty(getData.LeaderNames))
{
name += "," + getData.LeaderNames;
}
}
}
return name;
}
}
}
@@ -0,0 +1,152 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
/// <summary>
/// 安全领导小组会议
/// </summary>
public static class SafetyLeaderGroupMeetingService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取安全领导小组会议
/// </summary>
/// <param name="SafetyLeaderGroupMeetingId"></param>
/// <returns></returns>
public static Model.Meeting_SafetyLeaderGroupMeeting GetSafetyLeaderGroupMeetingById(string SafetyLeaderGroupMeetingId)
{
return Funs.DB.Meeting_SafetyLeaderGroupMeeting.FirstOrDefault(e => e.SafetyLeaderGroupMeetingId == SafetyLeaderGroupMeetingId);
}
/// <summary>
/// 根据时间段获取安全领导小组会议集合
/// </summary>
/// <param name="startTime"></param>
/// <param name="endTime"></param>
/// <param name="projectId"></param>
/// <returns></returns>
public static int GetCountByTime(DateTime startTime, DateTime endTime, string projectId)
{
return (from x in Funs.DB.Meeting_SafetyLeaderGroupMeeting where x.SafetyLeaderGroupMeetingDate >= startTime && x.SafetyLeaderGroupMeetingDate < endTime && x.ProjectId == projectId && x.States == BLL.Const.State_2 select x).Count();
}
/// <summary>
/// 根据时间段获取安全领导小组会议参会人数
/// </summary>
/// <param name="startTime"></param>
/// <param name="endTime"></param>
/// <param name="projectId"></param>
/// <returns></returns>
public static int? GetSumAttentPersonNumByMeetingDate(DateTime startTime, DateTime endTime, string projectId)
{
int? sumAttentPersonNum = (from x in Funs.DB.Meeting_SafetyLeaderGroupMeeting where x.SafetyLeaderGroupMeetingDate >= startTime && x.SafetyLeaderGroupMeetingDate < endTime && x.ProjectId == projectId && x.States == BLL.Const.State_2 select x.AttentPersonNum).Sum();
if (sumAttentPersonNum == null)
{
return 0;
}
return sumAttentPersonNum;
}
/// <summary>
/// 根据日期和类型获取会议记录集合
/// </summary>
/// <param name="startTime">开始时间</param>
/// <param name="endTime">结束时间</param>
/// <param name="projectId">项目号</param>
/// <returns>会议记录集合</returns>
public static List<Model.Meeting_SafetyLeaderGroupMeeting> GetMeetingListsByDate(DateTime startTime, DateTime endTime, string projectId)
{
return (from x in Funs.DB.Meeting_SafetyLeaderGroupMeeting where x.SafetyLeaderGroupMeetingDate >= startTime && x.SafetyLeaderGroupMeetingDate <= endTime && x.ProjectId == projectId orderby x.SafetyLeaderGroupMeetingDate select x).ToList();
}
/// <summary>
/// 添加安全领导小组会议
/// </summary>
/// <param name="SafetyLeaderGroupMeeting"></param>
public static void AddSafetyLeaderGroupMeeting(Model.Meeting_SafetyLeaderGroupMeeting SafetyLeaderGroupMeeting)
{
Model.SGGLDB db = Funs.DB;
Model.Meeting_SafetyLeaderGroupMeeting newSafetyLeaderGroupMeeting = new Model.Meeting_SafetyLeaderGroupMeeting
{
SafetyLeaderGroupMeetingId = SafetyLeaderGroupMeeting.SafetyLeaderGroupMeetingId,
ProjectId = SafetyLeaderGroupMeeting.ProjectId,
UnitId = SafetyLeaderGroupMeeting.UnitId,
SafetyLeaderGroupMeetingCode = SafetyLeaderGroupMeeting.SafetyLeaderGroupMeetingCode,
SafetyLeaderGroupMeetingName = SafetyLeaderGroupMeeting.SafetyLeaderGroupMeetingName,
SafetyLeaderGroupMeetingDate = SafetyLeaderGroupMeeting.SafetyLeaderGroupMeetingDate,
CompileMan = SafetyLeaderGroupMeeting.CompileMan,
SafetyLeaderGroupMeetingContents = SafetyLeaderGroupMeeting.SafetyLeaderGroupMeetingContents,
CompileDate = SafetyLeaderGroupMeeting.CompileDate,
States = SafetyLeaderGroupMeeting.States,
AttentPersonNum = SafetyLeaderGroupMeeting.AttentPersonNum,
MeetingHours = SafetyLeaderGroupMeeting.MeetingHours,
MeetingHostMan = SafetyLeaderGroupMeeting.MeetingHostMan,
AttentPerson = SafetyLeaderGroupMeeting.AttentPerson,
MeetingPlace = SafetyLeaderGroupMeeting.MeetingPlace,
MeetingHostManId = SafetyLeaderGroupMeeting.MeetingHostManId,
AttentPersonIds = SafetyLeaderGroupMeeting.AttentPersonIds,
MeetingHostManOther = SafetyLeaderGroupMeeting.MeetingHostManOther
};
db.Meeting_SafetyLeaderGroupMeeting.InsertOnSubmit(newSafetyLeaderGroupMeeting);
db.SubmitChanges();
////增加一条编码记录
BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.ProjectSafetyLeaderGroupMeetingMenuId, SafetyLeaderGroupMeeting.ProjectId, null, SafetyLeaderGroupMeeting.SafetyLeaderGroupMeetingId, SafetyLeaderGroupMeeting.CompileDate);
}
/// <summary>
/// 修改安全领导小组会议
/// </summary>
/// <param name="SafetyLeaderGroupMeeting"></param>
public static void UpdateSafetyLeaderGroupMeeting(Model.Meeting_SafetyLeaderGroupMeeting SafetyLeaderGroupMeeting)
{
Model.SGGLDB db = Funs.DB;
Model.Meeting_SafetyLeaderGroupMeeting newSafetyLeaderGroupMeeting = db.Meeting_SafetyLeaderGroupMeeting.FirstOrDefault(e => e.SafetyLeaderGroupMeetingId == SafetyLeaderGroupMeeting.SafetyLeaderGroupMeetingId);
if (newSafetyLeaderGroupMeeting != null)
{
//newSafetyLeaderGroupMeeting.ProjectId = SafetyLeaderGroupMeeting.ProjectId;
newSafetyLeaderGroupMeeting.UnitId = SafetyLeaderGroupMeeting.UnitId;
newSafetyLeaderGroupMeeting.SafetyLeaderGroupMeetingCode = SafetyLeaderGroupMeeting.SafetyLeaderGroupMeetingCode;
newSafetyLeaderGroupMeeting.SafetyLeaderGroupMeetingName = SafetyLeaderGroupMeeting.SafetyLeaderGroupMeetingName;
newSafetyLeaderGroupMeeting.SafetyLeaderGroupMeetingDate = SafetyLeaderGroupMeeting.SafetyLeaderGroupMeetingDate;
newSafetyLeaderGroupMeeting.CompileMan = SafetyLeaderGroupMeeting.CompileMan;
newSafetyLeaderGroupMeeting.SafetyLeaderGroupMeetingContents = SafetyLeaderGroupMeeting.SafetyLeaderGroupMeetingContents;
newSafetyLeaderGroupMeeting.CompileDate = SafetyLeaderGroupMeeting.CompileDate;
newSafetyLeaderGroupMeeting.States = SafetyLeaderGroupMeeting.States;
newSafetyLeaderGroupMeeting.AttentPersonNum = SafetyLeaderGroupMeeting.AttentPersonNum;
newSafetyLeaderGroupMeeting.MeetingHours = SafetyLeaderGroupMeeting.MeetingHours;
newSafetyLeaderGroupMeeting.MeetingHostMan = SafetyLeaderGroupMeeting.MeetingHostMan;
newSafetyLeaderGroupMeeting.AttentPerson = SafetyLeaderGroupMeeting.AttentPerson;
newSafetyLeaderGroupMeeting.MeetingPlace = SafetyLeaderGroupMeeting.MeetingPlace;
newSafetyLeaderGroupMeeting.MeetingHostManId = SafetyLeaderGroupMeeting.MeetingHostManId;
newSafetyLeaderGroupMeeting.AttentPersonIds = SafetyLeaderGroupMeeting.AttentPersonIds;
newSafetyLeaderGroupMeeting.MeetingHostManOther = SafetyLeaderGroupMeeting.MeetingHostManOther;
db.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除安全领导小组会议
/// </summary>
/// <param name="SafetyLeaderGroupMeetingId"></param>
public static void DeleteSafetyLeaderGroupMeetingById(string SafetyLeaderGroupMeetingId)
{
Model.SGGLDB db = Funs.DB;
Model.Meeting_SafetyLeaderGroupMeeting SafetyLeaderGroupMeeting = db.Meeting_SafetyLeaderGroupMeeting.FirstOrDefault(e => e.SafetyLeaderGroupMeetingId == SafetyLeaderGroupMeetingId);
if (SafetyLeaderGroupMeeting != null)
{
///删除编码表记录
BLL.CodeRecordsService.DeleteCodeRecordsByDataId(SafetyLeaderGroupMeetingId);
BLL.CommonService.DeleteAttachFileById(SafetyLeaderGroupMeetingId);
////删除流程表
BLL.CommonService.DeleteFlowOperateByID(SafetyLeaderGroupMeeting.SafetyLeaderGroupMeetingId);
db.Meeting_SafetyLeaderGroupMeeting.DeleteOnSubmit(SafetyLeaderGroupMeeting);
db.SubmitChanges();
}
}
}
}
@@ -45,7 +45,7 @@ namespace BLL
/// <returns></returns>
public static IEnumerable getListData(string projetcId, string unitId, string workPostId, string name, string idCard, string states, string personType, Grid Grid1)
{
IQueryable<Model.View_SitePerson_Person> getDataList = getDataLists.OrderBy(x => x.ProjectId).ThenBy(x => x.UnitId);
IQueryable<Model.View_SitePerson_Person> getDataList = getDataLists;
if (!string.IsNullOrEmpty(projetcId) && projetcId != Const._Null)
{
getDataList = getDataList.Where(e => e.ProjectId == projetcId);
@@ -79,7 +79,7 @@ namespace BLL
{
return null;
}
getDataList = SortConditionHelper.SortingAndPaging(getDataList, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
getDataList = SortConditionHelper.SortingAndPaging(getDataList.OrderBy(x => x.ProjectId).ThenBy(x => x.UnitId), Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
return from x in getDataList
select new
{
@@ -698,6 +698,7 @@ namespace BLL
InTime = person.InTime.HasValue ? person.InTime : DateTime.Now,
Isprint = "0",
States = person.States,
IsSafetyMonitoring=person.IsSafetyMonitoring,
};
////现场人员项目出入场记录
@@ -767,6 +768,7 @@ namespace BLL
newPerson.States = person.States;
setPersonItemInOut = true;
}
newPerson.IsSafetyMonitoring = person.IsSafetyMonitoring;
db.SubmitChanges();
if (!setPersonItemInOut)
+10 -4
View File
@@ -639,10 +639,16 @@ namespace BLL
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
List<Model.Person_Persons> list = new List<Model.Person_Persons>();
list = (from x in db.Person_Persons
where x.UnitId == unitId && x.DepartId == DepartId
orderby x.PersonName
select x).ToList();
var getPersons = from x in db.Person_Persons select x;
if (!string.IsNullOrEmpty(unitId))
{
getPersons = getPersons.Where(x => x.UnitId == unitId);
}
if (!string.IsNullOrEmpty(DepartId))
{
getPersons = getPersons.Where(x => x.DepartId == DepartId);
}
list = getPersons.OrderBy(x=>x.UnitId).OrderBy(x=>x.PersonName).ToList();
return list;
}
}
+21 -8
View File
@@ -289,24 +289,37 @@ namespace BLL
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
List<Model.Base_Unit> unitList = new List<Model.Base_Unit>();
if (unitType != Const.ProjectUnitType_2)
if (!string.IsNullOrEmpty(unitType))
{
unitList = (from x in db.Base_Unit
join y in db.Project_ProjectUnit
on x.UnitId equals y.UnitId
where y.ProjectId == projectId && y.UnitType == unitType
orderby x.UnitCode
select x).ToList();
if (unitType != Const.ProjectUnitType_2)
{
unitList = (from x in db.Base_Unit
join y in db.Project_ProjectUnit
on x.UnitId equals y.UnitId
where y.ProjectId == projectId && y.UnitType == unitType
orderby x.UnitCode
select x).ToList();
}
else
{
unitList = (from x in db.Base_Unit
join y in db.Project_ProjectUnit
on x.UnitId equals y.UnitId
where y.ProjectId == projectId && (y.UnitType == BLL.Const.ProjectUnitType_2 || y.UnitType == BLL.Const.ProjectUnitType_6)
orderby x.UnitCode
select x).ToList();
}
}
else
{
unitList = (from x in db.Base_Unit
join y in db.Project_ProjectUnit
on x.UnitId equals y.UnitId
where y.ProjectId == projectId && (y.UnitType == BLL.Const.ProjectUnitType_2 || y.UnitType == BLL.Const.ProjectUnitType_6)
where y.ProjectId == projectId
orderby x.UnitCode
select x).ToList();
}
return unitList;
}
}
@@ -0,0 +1,155 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BLL
{
/// <summary>
/// 应急演练
/// </summary>
public static class UnitDrillRecordListService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取应急演练
/// </summary>
/// <param name="DrillRecordListId"></param>
/// <returns></returns>
public static Model.Emergency_DrillRecordList_Unit GetDrillRecordListById(string DrillRecordListId)
{
return Funs.DB.Emergency_DrillRecordList_Unit.FirstOrDefault(e => e.DrillRecordListId == DrillRecordListId);
}
/// <summary>
/// 根据时间获取应急演练信息
/// </summary>
/// <param name="startTime">开始时间</param>
/// <param name="endTime">结束时间</param>
/// <returns>应急演练信息</returns>
public static List<Model.Emergency_DrillRecordList_Unit> GetDrillRecordListsByDrillRecordDate(DateTime startTime, DateTime endTime, string projectId)
{
return (from x in Funs.DB.Emergency_DrillRecordList_Unit where x.DrillRecordDate >= startTime && x.DrillRecordDate < endTime && x.ProjectId == projectId && x.States == BLL.Const.State_2 select x).ToList();
}
/// <summary>
/// 根据时间段获取HSE应急演练
/// </summary>
/// <param name="startTime">开始时间</param>
/// <param name="endTime">结束时间</param>
/// <param name="projectId">项目Id</param>
/// <returns>时间段内的HSE应急演练数量</returns>
public static int GetCountByDate(DateTime startTime, DateTime endTime, string projectId)
{
return (from x in Funs.DB.Emergency_DrillRecordList_Unit where x.DrillRecordDate >= startTime && x.DrillRecordDate <= endTime && x.ProjectId == projectId select x).Count();
}
/// <summary>
/// 根据时间段获取HSE应急演练
/// </summary>
/// <param name="startTime">开始时间</param>
/// <param name="endTime">结束时间</param>
/// <param name="projectId">项目Id</param>
/// <returns>时间段内的HSE应急演练数量</returns>
public static int GetCountByDate2(DateTime startTime, DateTime endTime, string projectId)
{
return (from x in Funs.DB.Emergency_DrillRecordList_Unit where x.DrillRecordDate >= startTime && x.DrillRecordDate < endTime && x.ProjectId == projectId select x).Count();
}
/// <summary>
/// 获取HSE应急演练
/// </summary>
/// <param name="startTime">开始时间</param>
/// <param name="endTime">结束时间</param>
/// <param name="projectId">项目Id</param>
/// <returns>时间段内的HSE应急演练数量</returns>
public static int GetCount(string projectId)
{
return (from x in Funs.DB.Emergency_DrillRecordList_Unit where x.ProjectId == projectId select x).Count();
}
/// <summary>
/// 添加应急演练
/// </summary>
/// <param name="DrillRecordList"></param>
public static void AddDrillRecordList(Model.Emergency_DrillRecordList_Unit DrillRecordList)
{
Model.SGGLDB db = Funs.DB;
Model.Emergency_DrillRecordList_Unit newDrillRecordList = new Model.Emergency_DrillRecordList_Unit
{
DrillRecordListId = DrillRecordList.DrillRecordListId,
ProjectId = DrillRecordList.ProjectId,
DrillRecordCode = DrillRecordList.DrillRecordCode,
DrillRecordName = DrillRecordList.DrillRecordName,
UnitIds = DrillRecordList.UnitIds,
UnitNames = DrillRecordList.UnitNames,
UserIds = DrillRecordList.UserIds,
UserNames = DrillRecordList.UserNames,
DrillRecordDate = DrillRecordList.DrillRecordDate,
DrillRecordContents = DrillRecordList.DrillRecordContents,
CompileMan = DrillRecordList.CompileMan,
CompileDate = System.DateTime.Now,
States = DrillRecordList.States,
AttachUrl = DrillRecordList.AttachUrl,
DrillRecordType = DrillRecordList.DrillRecordType,
JointPersonNum = DrillRecordList.JointPersonNum,
DrillCost = DrillRecordList.DrillCost
};
db.Emergency_DrillRecordList_Unit.InsertOnSubmit(newDrillRecordList);
db.SubmitChanges();
////增加一条编码记录
BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.ProjectDrillRecordListMenuId, DrillRecordList.ProjectId, null, DrillRecordList.DrillRecordListId, DrillRecordList.DrillRecordDate);
}
/// <summary>
/// 修改应急演练
/// </summary>
/// <param name="DrillRecordList"></param>
public static void UpdateDrillRecordList(Model.Emergency_DrillRecordList_Unit DrillRecordList)
{
Model.SGGLDB db = Funs.DB;
Model.Emergency_DrillRecordList_Unit newDrillRecordList = db.Emergency_DrillRecordList_Unit.FirstOrDefault(e => e.DrillRecordListId == DrillRecordList.DrillRecordListId);
if (newDrillRecordList != null)
{
newDrillRecordList.DrillRecordCode = DrillRecordList.DrillRecordCode;
newDrillRecordList.DrillRecordName = DrillRecordList.DrillRecordName;
newDrillRecordList.UnitIds = DrillRecordList.UnitIds;
newDrillRecordList.UnitNames = DrillRecordList.UnitNames;
newDrillRecordList.UserIds = DrillRecordList.UserIds;
newDrillRecordList.UserNames = DrillRecordList.UserNames;
newDrillRecordList.DrillRecordDate = DrillRecordList.DrillRecordDate;
newDrillRecordList.DrillRecordContents = DrillRecordList.DrillRecordContents;
newDrillRecordList.CompileMan = DrillRecordList.CompileMan;
//newDrillRecordList.CompileDate = DrillRecordList.CompileDate;
newDrillRecordList.States = DrillRecordList.States;
newDrillRecordList.AttachUrl = DrillRecordList.AttachUrl;
newDrillRecordList.DrillRecordType = DrillRecordList.DrillRecordType;
newDrillRecordList.JointPersonNum = DrillRecordList.JointPersonNum;
newDrillRecordList.DrillCost = DrillRecordList.DrillCost;
db.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除应急演练
/// </summary>
/// <param name="DrillRecordListId"></param>
public static void DeleteDrillRecordListById(string DrillRecordListId)
{
Model.SGGLDB db = Funs.DB;
Model.Emergency_DrillRecordList_Unit DrillRecordList = db.Emergency_DrillRecordList_Unit.FirstOrDefault(e => e.DrillRecordListId == DrillRecordListId);
if (DrillRecordList != null)
{
///删除编码表记录
BLL.CodeRecordsService.DeleteCodeRecordsByDataId(DrillRecordList.DrillRecordListId);
////删除附件表
BLL.CommonService.DeleteAttachFileById(DrillRecordList.DrillRecordListId);
////删除流程表
BLL.CommonService.DeleteFlowOperateByID(DrillRecordList.DrillRecordListId);
db.Emergency_DrillRecordList_Unit.DeleteOnSubmit(DrillRecordList);
db.SubmitChanges();
}
}
}
}
@@ -0,0 +1,150 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BLL
{
/// <summary>
/// 应急预案管理
/// </summary>
public static class UnitEmergencyListService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取应急预案管理
/// </summary>
/// <param name="EmergencyListId"></param>
/// <returns></returns>
public static Model.Emergency_EmergencyList_Unit GetEmergencyListById(string EmergencyListId)
{
return Funs.DB.Emergency_EmergencyList_Unit.FirstOrDefault(e => e.EmergencyListId == EmergencyListId);
}
/// <summary>
/// 获取时间段文件、方案修编情况说明
/// </summary>
/// <param name="projectId"></param>
/// <param name="startTime"></param>
/// <param name="endTime"></param>
/// <returns></returns>
public static List<Model.Emergency_EmergencyList_Unit> GetEmergencyListByDate(string projectId, DateTime startTime, DateTime endTime)
{
return (from x in Funs.DB.Emergency_EmergencyList_Unit where x.ProjectId == projectId && x.CompileDate >= startTime && x.CompileDate <= endTime select x).ToList();
}
/// <summary>
/// 根据应急预案类型获取应急预案信息集合
/// </summary>
/// <param name="emergencyType">应急预案类型</param>
/// <param name="projectId">项目号</param>
/// <returns>应急预案实体集合</returns>
public static List<Model.Emergency_EmergencyList_Unit> GetEmergencyListsByEmergencyType(string emergencyType, string projectId, DateTime startTime, DateTime endTime)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
return (from x in db.Emergency_EmergencyList_Unit
join y in db.Base_EmergencyType
on x.EmergencyTypeId equals y.EmergencyTypeId
where y.EmergencyTypeName.Contains(emergencyType) && x.ProjectId == projectId && x.CompileDate >= startTime && x.CompileDate < endTime
select x).ToList();
}
}
/// <summary>
/// 根据应急预案类型获取其他应急预案信息集合
/// </summary>
/// <param name="emergencyType">应急预案类型</param>
/// <param name="projectId">项目号</param>
/// <returns>其他应急预案实体集合</returns>
public static List<Model.Emergency_EmergencyList_Unit> GetOtherEmergencyListsByEmergencyType(string emergencyType, string projectId, DateTime startTime, DateTime endTime)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
return (from x in db.Emergency_EmergencyList_Unit
join y in db.Base_EmergencyType
on x.EmergencyTypeId equals y.EmergencyTypeId
where !y.EmergencyTypeName.Contains(emergencyType) && x.ProjectId == projectId && x.CompileDate >= startTime && x.CompileDate < endTime
select x).ToList();
}
}
/// <summary>
/// 添加应急预案管理
/// </summary>
/// <param name="EmergencyList"></param>
public static void AddEmergencyList(Model.Emergency_EmergencyList_Unit EmergencyList)
{
Model.SGGLDB db = Funs.DB;
Model.Emergency_EmergencyList_Unit newEmergencyList = new Model.Emergency_EmergencyList_Unit
{
EmergencyListId = EmergencyList.EmergencyListId,
ProjectId = EmergencyList.ProjectId,
EmergencyCode = EmergencyList.EmergencyCode,
EmergencyName = EmergencyList.EmergencyName,
UnitId = EmergencyList.UnitId,
EmergencyTypeId = EmergencyList.EmergencyTypeId,
VersionCode = EmergencyList.VersionCode,
EmergencyContents = EmergencyList.EmergencyContents,
CompileMan = EmergencyList.CompileMan,
CompileDate = EmergencyList.CompileDate,
States = EmergencyList.States,
AttachUrl = EmergencyList.AttachUrl,
AuditMan = EmergencyList.AuditMan,
ApproveMan = EmergencyList.ApproveMan
};
db.Emergency_EmergencyList_Unit.InsertOnSubmit(newEmergencyList);
db.SubmitChanges();
////增加一条编码记录
BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.ProjectEmergencyListMenuId, EmergencyList.ProjectId, null, EmergencyList.EmergencyListId, EmergencyList.CompileDate);
}
/// <summary>
/// 修改应急预案管理
/// </summary>
/// <param name="EmergencyList"></param>
public static void UpdateEmergencyList(Model.Emergency_EmergencyList_Unit EmergencyList)
{
Model.SGGLDB db = Funs.DB;
Model.Emergency_EmergencyList_Unit newEmergencyList = db.Emergency_EmergencyList_Unit.FirstOrDefault(e => e.EmergencyListId == EmergencyList.EmergencyListId);
if (newEmergencyList != null)
{
newEmergencyList.EmergencyCode = EmergencyList.EmergencyCode;
newEmergencyList.EmergencyName = EmergencyList.EmergencyName;
newEmergencyList.UnitId = EmergencyList.UnitId;
newEmergencyList.EmergencyTypeId = EmergencyList.EmergencyTypeId;
newEmergencyList.VersionCode = EmergencyList.VersionCode;
newEmergencyList.EmergencyContents = EmergencyList.EmergencyContents;
newEmergencyList.CompileMan = EmergencyList.CompileMan;
newEmergencyList.CompileDate = EmergencyList.CompileDate;
newEmergencyList.States = EmergencyList.States;
newEmergencyList.AttachUrl = EmergencyList.AttachUrl;
newEmergencyList.AuditMan = EmergencyList.AuditMan;
newEmergencyList.ApproveMan = EmergencyList.ApproveMan;
db.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除应急预案管理
/// </summary>
/// <param name="EmergencyListId"></param>
public static void DeleteEmergencyListById(string EmergencyListId)
{
Model.SGGLDB db = Funs.DB;
Model.Emergency_EmergencyList_Unit EmergencyList = db.Emergency_EmergencyList_Unit.FirstOrDefault(e => e.EmergencyListId == EmergencyListId);
if (EmergencyList != null)
{
///删除编码表记录
BLL.CodeRecordsService.DeleteCodeRecordsByDataId(EmergencyList.EmergencyListId);
////删除附件表
BLL.CommonService.DeleteAttachFileById(EmergencyList.EmergencyListId);
////删除流程表
BLL.CommonService.DeleteFlowOperateByID(EmergencyList.EmergencyListId);
db.Emergency_EmergencyList_Unit.DeleteOnSubmit(EmergencyList);
db.SubmitChanges();
}
}
}
}
@@ -0,0 +1,142 @@
using System;
using System.Collections.Generic;
using System.Linq;
namespace BLL
{
/// <summary>
/// 企业安委会
/// </summary>
public static class CompanySafetyMeetingService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取企业安委会
/// </summary>
/// <param name="CompanySafetyMeetingId"></param>
/// <returns></returns>
public static Model.Meeting_CompanySafetyMeeting GetCompanySafetyMeetingById(string CompanySafetyMeetingId)
{
return Funs.DB.Meeting_CompanySafetyMeeting.FirstOrDefault(e => e.CompanySafetyMeetingId == CompanySafetyMeetingId);
}
/// <summary>
/// 根据时间段获取月例会集合
/// </summary>
/// <param name="startTime"></param>
/// <param name="endTime"></param>
/// <param name="projectId"></param>
/// <returns></returns>
public static int GetCountByTime(DateTime startTime, DateTime endTime)
{
return (from x in Funs.DB.Meeting_CompanySafetyMeeting where x.CompanySafetyMeetingDate >= startTime && x.CompanySafetyMeetingDate < endTime select x).Count();
}
/// <summary>
/// 根据时间段获取月例会参会人数
/// </summary>
/// <param name="startTime"></param>
/// <param name="endTime"></param>
/// <param name="projectId"></param>
/// <returns></returns>
public static int? GetSumAttentPersonNumByMeetingDate(DateTime startTime, DateTime endTime)
{
int? sumAttentPersonNum = (from x in Funs.DB.Meeting_CompanySafetyMeeting where x.CompanySafetyMeetingDate >= startTime && x.CompanySafetyMeetingDate < endTime select x.AttentPersonNum).Sum();
if (sumAttentPersonNum == null)
{
return 0;
}
return sumAttentPersonNum;
}
/// <summary>
/// 根据日期和类型获取会议记录集合
/// </summary>
/// <param name="startTime">开始时间</param>
/// <param name="endTime">结束时间</param>
/// <param name="projectId">项目号</param>
/// <returns>会议记录集合</returns>
public static List<Model.Meeting_CompanySafetyMeeting> GetMeetingListsByDate(DateTime startTime, DateTime endTime)
{
return (from x in Funs.DB.Meeting_CompanySafetyMeeting where x.CompanySafetyMeetingDate >= startTime && x.CompanySafetyMeetingDate <= endTime orderby x.CompanySafetyMeetingDate select x).ToList();
}
/// <summary>
/// 添加企业安委会
/// </summary>
/// <param name="CompanySafetyMeeting"></param>
public static void AddCompanySafetyMeeting(Model.Meeting_CompanySafetyMeeting CompanySafetyMeeting)
{
Model.SGGLDB db = Funs.DB;
Model.Meeting_CompanySafetyMeeting newCompanySafetyMeeting = new Model.Meeting_CompanySafetyMeeting
{
CompanySafetyMeetingId = CompanySafetyMeeting.CompanySafetyMeetingId,
CompanySafetyMeetingCode = CompanySafetyMeeting.CompanySafetyMeetingCode,
CompanySafetyMeetingName = CompanySafetyMeeting.CompanySafetyMeetingName,
CompanySafetyMeetingDate = CompanySafetyMeeting.CompanySafetyMeetingDate,
CompileMan = CompanySafetyMeeting.CompileMan,
CompanySafetyMeetingContents = CompanySafetyMeeting.CompanySafetyMeetingContents,
CompileDate = CompanySafetyMeeting.CompileDate,
AttentPersonNum = CompanySafetyMeeting.AttentPersonNum,
MeetingHours = CompanySafetyMeeting.MeetingHours,
MeetingHostMan = CompanySafetyMeeting.MeetingHostMan,
AttentPerson = CompanySafetyMeeting.AttentPerson,
MeetingPlace = CompanySafetyMeeting.MeetingPlace,
MeetingHostManId = CompanySafetyMeeting.MeetingHostManId,
AttentPersonIds = CompanySafetyMeeting.AttentPersonIds,
MeetingHostManOther = CompanySafetyMeeting.MeetingHostManOther
};
db.Meeting_CompanySafetyMeeting.InsertOnSubmit(newCompanySafetyMeeting);
db.SubmitChanges();
////增加一条编码记录
BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.CompanySafetyMeetingMenuId, null, null, CompanySafetyMeeting.CompanySafetyMeetingId, CompanySafetyMeeting.CompileDate);
}
/// <summary>
/// 修改企业安委会
/// </summary>
/// <param name="CompanySafetyMeeting"></param>
public static void UpdateCompanySafetyMeeting(Model.Meeting_CompanySafetyMeeting CompanySafetyMeeting)
{
Model.SGGLDB db = Funs.DB;
Model.Meeting_CompanySafetyMeeting newCompanySafetyMeeting = db.Meeting_CompanySafetyMeeting.FirstOrDefault(e => e.CompanySafetyMeetingId == CompanySafetyMeeting.CompanySafetyMeetingId);
if (newCompanySafetyMeeting != null)
{
newCompanySafetyMeeting.CompanySafetyMeetingCode = CompanySafetyMeeting.CompanySafetyMeetingCode;
newCompanySafetyMeeting.CompanySafetyMeetingName = CompanySafetyMeeting.CompanySafetyMeetingName;
newCompanySafetyMeeting.CompanySafetyMeetingDate = CompanySafetyMeeting.CompanySafetyMeetingDate;
newCompanySafetyMeeting.CompileMan = CompanySafetyMeeting.CompileMan;
newCompanySafetyMeeting.CompanySafetyMeetingContents = CompanySafetyMeeting.CompanySafetyMeetingContents;
newCompanySafetyMeeting.CompileDate = CompanySafetyMeeting.CompileDate;
newCompanySafetyMeeting.AttentPersonNum = CompanySafetyMeeting.AttentPersonNum;
newCompanySafetyMeeting.MeetingHours = CompanySafetyMeeting.MeetingHours;
newCompanySafetyMeeting.MeetingHostMan = CompanySafetyMeeting.MeetingHostMan;
newCompanySafetyMeeting.AttentPerson = CompanySafetyMeeting.AttentPerson;
newCompanySafetyMeeting.MeetingPlace = CompanySafetyMeeting.MeetingPlace;
newCompanySafetyMeeting.MeetingHostManId = CompanySafetyMeeting.MeetingHostManId;
newCompanySafetyMeeting.AttentPersonIds = CompanySafetyMeeting.AttentPersonIds;
newCompanySafetyMeeting.MeetingHostManOther = CompanySafetyMeeting.MeetingHostManOther;
db.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除企业安委会
/// </summary>
/// <param name="CompanySafetyMeetingId"></param>
public static void DeleteCompanySafetyMeetingById(string CompanySafetyMeetingId)
{
Model.SGGLDB db = Funs.DB;
Model.Meeting_CompanySafetyMeeting CompanySafetyMeeting = db.Meeting_CompanySafetyMeeting.FirstOrDefault(e => e.CompanySafetyMeetingId == CompanySafetyMeetingId);
if (CompanySafetyMeeting != null)
{
///删除编码表记录
BLL.CodeRecordsService.DeleteCodeRecordsByDataId(CompanySafetyMeetingId);
BLL.CommonService.DeleteAttachFileById(CompanySafetyMeetingId);
db.Meeting_CompanySafetyMeeting.DeleteOnSubmit(CompanySafetyMeeting);
db.SubmitChanges();
}
}
}
}
@@ -0,0 +1,142 @@
using System;
using System.Collections.Generic;
using System.Linq;
namespace BLL
{
/// <summary>
/// 企业专题会
/// </summary>
public static class CompanySpecialMeetingService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取企业专题会
/// </summary>
/// <param name="CompanySpecialMeetingId"></param>
/// <returns></returns>
public static Model.Meeting_CompanySpecialMeeting GetCompanySpecialMeetingById(string CompanySpecialMeetingId)
{
return Funs.DB.Meeting_CompanySpecialMeeting.FirstOrDefault(e => e.CompanySpecialMeetingId == CompanySpecialMeetingId);
}
/// <summary>
/// 根据时间段获取月例会集合
/// </summary>
/// <param name="startTime"></param>
/// <param name="endTime"></param>
/// <param name="projectId"></param>
/// <returns></returns>
public static int GetCountByTime(DateTime startTime, DateTime endTime)
{
return (from x in Funs.DB.Meeting_CompanySpecialMeeting where x.CompanySpecialMeetingDate >= startTime && x.CompanySpecialMeetingDate < endTime select x).Count();
}
/// <summary>
/// 根据时间段获取月例会参会人数
/// </summary>
/// <param name="startTime"></param>
/// <param name="endTime"></param>
/// <param name="projectId"></param>
/// <returns></returns>
public static int? GetSumAttentPersonNumByMeetingDate(DateTime startTime, DateTime endTime)
{
int? sumAttentPersonNum = (from x in Funs.DB.Meeting_CompanySpecialMeeting where x.CompanySpecialMeetingDate >= startTime && x.CompanySpecialMeetingDate < endTime select x.AttentPersonNum).Sum();
if (sumAttentPersonNum == null)
{
return 0;
}
return sumAttentPersonNum;
}
/// <summary>
/// 根据日期和类型获取会议记录集合
/// </summary>
/// <param name="startTime">开始时间</param>
/// <param name="endTime">结束时间</param>
/// <param name="projectId">项目号</param>
/// <returns>会议记录集合</returns>
public static List<Model.Meeting_CompanySpecialMeeting> GetMeetingListsByDate(DateTime startTime, DateTime endTime)
{
return (from x in Funs.DB.Meeting_CompanySpecialMeeting where x.CompanySpecialMeetingDate >= startTime && x.CompanySpecialMeetingDate <= endTime orderby x.CompanySpecialMeetingDate select x).ToList();
}
/// <summary>
/// 添加企业专题会
/// </summary>
/// <param name="CompanySpecialMeeting"></param>
public static void AddCompanySpecialMeeting(Model.Meeting_CompanySpecialMeeting CompanySpecialMeeting)
{
Model.SGGLDB db = Funs.DB;
Model.Meeting_CompanySpecialMeeting newCompanySpecialMeeting = new Model.Meeting_CompanySpecialMeeting
{
CompanySpecialMeetingId = CompanySpecialMeeting.CompanySpecialMeetingId,
CompanySpecialMeetingCode = CompanySpecialMeeting.CompanySpecialMeetingCode,
CompanySpecialMeetingName = CompanySpecialMeeting.CompanySpecialMeetingName,
CompanySpecialMeetingDate = CompanySpecialMeeting.CompanySpecialMeetingDate,
CompileMan = CompanySpecialMeeting.CompileMan,
CompanySpecialMeetingContents = CompanySpecialMeeting.CompanySpecialMeetingContents,
CompileDate = CompanySpecialMeeting.CompileDate,
AttentPersonNum = CompanySpecialMeeting.AttentPersonNum,
MeetingHours = CompanySpecialMeeting.MeetingHours,
MeetingHostMan = CompanySpecialMeeting.MeetingHostMan,
AttentPerson = CompanySpecialMeeting.AttentPerson,
MeetingPlace = CompanySpecialMeeting.MeetingPlace,
MeetingHostManId = CompanySpecialMeeting.MeetingHostManId,
AttentPersonIds = CompanySpecialMeeting.AttentPersonIds,
MeetingHostManOther = CompanySpecialMeeting.MeetingHostManOther
};
db.Meeting_CompanySpecialMeeting.InsertOnSubmit(newCompanySpecialMeeting);
db.SubmitChanges();
////增加一条编码记录
BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.CompanySpecialMeetingMenuId, null, null, CompanySpecialMeeting.CompanySpecialMeetingId, CompanySpecialMeeting.CompileDate);
}
/// <summary>
/// 修改企业专题会
/// </summary>
/// <param name="CompanySpecialMeeting"></param>
public static void UpdateCompanySpecialMeeting(Model.Meeting_CompanySpecialMeeting CompanySpecialMeeting)
{
Model.SGGLDB db = Funs.DB;
Model.Meeting_CompanySpecialMeeting newCompanySpecialMeeting = db.Meeting_CompanySpecialMeeting.FirstOrDefault(e => e.CompanySpecialMeetingId == CompanySpecialMeeting.CompanySpecialMeetingId);
if (newCompanySpecialMeeting != null)
{
newCompanySpecialMeeting.CompanySpecialMeetingCode = CompanySpecialMeeting.CompanySpecialMeetingCode;
newCompanySpecialMeeting.CompanySpecialMeetingName = CompanySpecialMeeting.CompanySpecialMeetingName;
newCompanySpecialMeeting.CompanySpecialMeetingDate = CompanySpecialMeeting.CompanySpecialMeetingDate;
newCompanySpecialMeeting.CompileMan = CompanySpecialMeeting.CompileMan;
newCompanySpecialMeeting.CompanySpecialMeetingContents = CompanySpecialMeeting.CompanySpecialMeetingContents;
newCompanySpecialMeeting.CompileDate = CompanySpecialMeeting.CompileDate;
newCompanySpecialMeeting.AttentPersonNum = CompanySpecialMeeting.AttentPersonNum;
newCompanySpecialMeeting.MeetingHours = CompanySpecialMeeting.MeetingHours;
newCompanySpecialMeeting.MeetingHostMan = CompanySpecialMeeting.MeetingHostMan;
newCompanySpecialMeeting.AttentPerson = CompanySpecialMeeting.AttentPerson;
newCompanySpecialMeeting.MeetingPlace = CompanySpecialMeeting.MeetingPlace;
newCompanySpecialMeeting.MeetingHostManId = CompanySpecialMeeting.MeetingHostManId;
newCompanySpecialMeeting.AttentPersonIds = CompanySpecialMeeting.AttentPersonIds;
newCompanySpecialMeeting.MeetingHostManOther = CompanySpecialMeeting.MeetingHostManOther;
db.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除企业专题会
/// </summary>
/// <param name="CompanySpecialMeetingId"></param>
public static void DeleteCompanySpecialMeetingById(string CompanySpecialMeetingId)
{
Model.SGGLDB db = Funs.DB;
Model.Meeting_CompanySpecialMeeting CompanySpecialMeeting = db.Meeting_CompanySpecialMeeting.FirstOrDefault(e => e.CompanySpecialMeetingId == CompanySpecialMeetingId);
if (CompanySpecialMeeting != null)
{
///删除编码表记录
BLL.CodeRecordsService.DeleteCodeRecordsByDataId(CompanySpecialMeetingId);
BLL.CommonService.DeleteAttachFileById(CompanySpecialMeetingId);
db.Meeting_CompanySpecialMeeting.DeleteOnSubmit(CompanySpecialMeeting);
db.SubmitChanges();
}
}
}
}
@@ -0,0 +1,84 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
/// <summary>
/// 监督检查报告明细
/// </summary>
public static class SubUnitCheckRectifyItemService
{
/// <summary>
/// 根据评价报告主键获取所有明细信息
/// </summary>
/// <param name="subUnitCheckRectifyId"></param>
/// <returns></returns>
public static List<Model.Supervise_SubUnitCheckRectifyItem> GetSubUnitCheckRectifyItemList(string subUnitCheckRectifyId)
{
return (from x in Funs.DB.Supervise_SubUnitCheckRectifyItem where x.SubUnitCheckRectifyId == subUnitCheckRectifyId orderby x.CheckDate descending select x).ToList();
}
/// <summary>
/// 添加监督评价报告明细
/// </summary>
/// <param name="item"></param>
public static void AddSubUnitCheckRectifyItem(Model.Supervise_SubUnitCheckRectifyItem item)
{
Model.Supervise_SubUnitCheckRectifyItem newItem = new Model.Supervise_SubUnitCheckRectifyItem
{
SubUnitCheckRectifyItemId = item.SubUnitCheckRectifyItemId,
SubUnitCheckRectifyId = item.SubUnitCheckRectifyId,
Name = item.Name,
Sex = item.Sex,
UnitName = item.UnitName,
PostName = item.PostName,
WorkTitle = item.WorkTitle,
CheckPostName = item.CheckPostName,
CheckDate = item.CheckDate
};
Funs.DB.Supervise_SubUnitCheckRectifyItem.InsertOnSubmit(newItem);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 根据评价报告主键删除所有相关明细信息
/// </summary>
/// <param name="subUnitCheckRectifyId"></param>
public static void DeleteSubUnitCheckRectifyItemsList(string subUnitCheckRectifyId)
{
var q = (from x in Funs.DB.Supervise_SubUnitCheckRectifyItem where x.SubUnitCheckRectifyId == subUnitCheckRectifyId select x).ToList();
if (q != null)
{
Funs.DB.Supervise_SubUnitCheckRectifyItem.DeleteAllOnSubmit(q);
Funs.DB.SubmitChanges();
}
}
/// <summary>
///
/// </summary>
/// <param name="superviseCheckReportId"></param>
public static void DeleteSubUnitCheckRectifyBySuperviseCheckReportId(string superviseCheckReportId)
{
var q = (from x in Funs.DB.Supervise_SubUnitCheckRectify where x.SuperviseCheckReportId == superviseCheckReportId select x);
if (q.Count() > 0)
{
foreach (var item in q)
{
var subUnitCheckRectifyItem = from x in Funs.DB.Supervise_SubUnitCheckRectifyItem where x.SubUnitCheckRectifyId == item.SubUnitCheckRectifyId select x;
if (subUnitCheckRectifyItem.Count() > 0)
{
Funs.DB.Supervise_SubUnitCheckRectifyItem.DeleteAllOnSubmit(subUnitCheckRectifyItem);
Funs.DB.SubmitChanges();
}
Funs.DB.Supervise_SubUnitCheckRectify.DeleteOnSubmit(item);
Funs.DB.SubmitChanges();
}
}
}
}
}
@@ -0,0 +1,90 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
/// <summary>
/// 监督评价报告
/// </summary>
public static class SubUnitCheckRectifyService
{
/// <summary>
/// 根据安全监督检查报告id获取监督评价信息
/// </summary>
/// <param name="superviseCheckReportId"></param>
/// <returns></returns>
public static Model.Supervise_SubUnitCheckRectify GetSubUnitCheckRectifyBySuperviseCheckReportId(string superviseCheckReportId)
{
return Funs.DB.Supervise_SubUnitCheckRectify.FirstOrDefault(e => e.SuperviseCheckReportId == superviseCheckReportId);
}
/// <summary>
/// 根据主键获取监督评价信息
/// </summary>
/// <param name="subUnitCheckRectifyId"></param>
/// <returns></returns>
public static Model.Supervise_SubUnitCheckRectify GetSubUnitCheckRectifyById(string subUnitCheckRectifyId)
{
return Funs.DB.Supervise_SubUnitCheckRectify.FirstOrDefault(e => e.SubUnitCheckRectifyId == subUnitCheckRectifyId);
}
/// <summary>
/// 添加监督评价报告
/// </summary>
/// <param name="subUnitCheckRectify"></param>
public static void AddSubUnitCheckRectify(Model.Supervise_SubUnitCheckRectify subUnitCheckRectify)
{
Model.Supervise_SubUnitCheckRectify newSubUnitCheckRectify = new Model.Supervise_SubUnitCheckRectify
{
SubUnitCheckRectifyId = subUnitCheckRectify.SubUnitCheckRectifyId,
SuperviseCheckReportId = subUnitCheckRectify.SuperviseCheckReportId,
UnitId = subUnitCheckRectify.UnitId,
CheckRectType = subUnitCheckRectify.CheckRectType,
Values1 = subUnitCheckRectify.Values1,
Values2 = subUnitCheckRectify.Values2,
Values3 = subUnitCheckRectify.Values3,
Values4 = subUnitCheckRectify.Values4,
Values5 = subUnitCheckRectify.Values5,
Values6 = subUnitCheckRectify.Values6,
Values7 = subUnitCheckRectify.Values7,
Values8 = subUnitCheckRectify.Values8,
AttachUrl = subUnitCheckRectify.AttachUrl,
UpDateTime = subUnitCheckRectify.UpDateTime,
CheckEndDate = subUnitCheckRectify.CheckEndDate,
UpState = subUnitCheckRectify.UpState
};
Funs.DB.Supervise_SubUnitCheckRectify.InsertOnSubmit(newSubUnitCheckRectify);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 修改监督评价报告
/// </summary>
/// <param name="subUnitCheckRectify"></param>
public static void UpdateSubUnitCheckRectify(Model.Supervise_SubUnitCheckRectify subUnitCheckRectify)
{
Model.Supervise_SubUnitCheckRectify newSubUnitCheckRectify = Funs.DB.Supervise_SubUnitCheckRectify.FirstOrDefault(e => e.SubUnitCheckRectifyId == subUnitCheckRectify.SubUnitCheckRectifyId);
if (newSubUnitCheckRectify != null)
{
newSubUnitCheckRectify.UnitId = subUnitCheckRectify.UnitId;
newSubUnitCheckRectify.CheckRectType = subUnitCheckRectify.CheckRectType;
newSubUnitCheckRectify.Values1 = subUnitCheckRectify.Values1;
newSubUnitCheckRectify.Values2 = subUnitCheckRectify.Values2;
newSubUnitCheckRectify.Values3 = subUnitCheckRectify.Values3;
newSubUnitCheckRectify.Values4 = subUnitCheckRectify.Values4;
newSubUnitCheckRectify.Values5 = subUnitCheckRectify.Values5;
newSubUnitCheckRectify.Values6 = subUnitCheckRectify.Values6;
newSubUnitCheckRectify.Values7 = subUnitCheckRectify.Values7;
newSubUnitCheckRectify.Values8 = subUnitCheckRectify.Values8;
newSubUnitCheckRectify.AttachUrl = subUnitCheckRectify.AttachUrl;
newSubUnitCheckRectify.UpDateTime = subUnitCheckRectify.UpDateTime;
newSubUnitCheckRectify.UpState = subUnitCheckRectify.UpState;
newSubUnitCheckRectify.CheckEndDate = subUnitCheckRectify.CheckEndDate;
Funs.DB.SubmitChanges();
}
}
}
}
@@ -0,0 +1,86 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
/// <summary>
/// 安全监督检查整改明细表
/// </summary>
public static class SuperviseCheckRectifyItemService
{
/// <summary>
/// 根据主键获取安全监督检查整改明细信息
/// </summary>
/// <param name="superviseCheckRectifyItemId"></param>
/// <returns></returns>
public static Model.Supervise_SuperviseCheckRectifyItem GetSuperviseCheckRectifyItemById(string superviseCheckRectifyItemId)
{
return Funs.DB.Supervise_SuperviseCheckRectifyItem.FirstOrDefault(e => e.SuperviseCheckRectifyItemId == superviseCheckRectifyItemId);
}
/// <summary>
/// 根据安全监督检查整改id获取所有相关明细信息
/// </summary>
/// <param name="superviseCheckRectifyId"></param>
/// <returns></returns>
public static List<Model.Supervise_SuperviseCheckRectifyItem> GetSuperviseCheckRectifyItemBySuperviseCheckRectifyId(string superviseCheckRectifyId)
{
return (from x in Funs.DB.Supervise_SuperviseCheckRectifyItem where x.SuperviseCheckRectifyId == superviseCheckRectifyId select x).ToList();
}
/// <summary>
/// 添加安全监督检查整改明细信息
/// </summary>
/// <param name="superviseCheckRectifyItem"></param>
public static void AddSuperviseCheckRectifyItem(Model.Supervise_SuperviseCheckRectifyItem superviseCheckRectifyItem)
{
Model.Supervise_SuperviseCheckRectifyItem newSuperviseCheckRectifyItem = new Model.Supervise_SuperviseCheckRectifyItem
{
SuperviseCheckRectifyItemId = superviseCheckRectifyItem.SuperviseCheckRectifyItemId,
SuperviseCheckRectifyId = superviseCheckRectifyItem.SuperviseCheckRectifyId,
RectifyItemId = superviseCheckRectifyItem.RectifyItemId,
ConfirmMan = superviseCheckRectifyItem.ConfirmMan,
ConfirmDate = superviseCheckRectifyItem.ConfirmDate,
OrderEndDate = superviseCheckRectifyItem.OrderEndDate,
OrderEndPerson = superviseCheckRectifyItem.OrderEndPerson,
RealEndDate = superviseCheckRectifyItem.RealEndDate,
AttachUrl = superviseCheckRectifyItem.AttachUrl,
VerifierName=superviseCheckRectifyItem.VerifierName,
VerifierDate=superviseCheckRectifyItem.VerifierDate,
};
Funs.DB.Supervise_SuperviseCheckRectifyItem.InsertOnSubmit(newSuperviseCheckRectifyItem);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 根据主键删除安全监督检查整改明细信息
/// </summary>
/// <param name="superviseCheckRectifyItemId"></param>
public static void DeleteSuperviseCheckRectifyItem(string superviseCheckRectifyItemId)
{
Model.Supervise_SuperviseCheckRectifyItem superviseCheckRectifyItem = Funs.DB.Supervise_SuperviseCheckRectifyItem.FirstOrDefault(e => e.SuperviseCheckRectifyItemId == superviseCheckRectifyItemId);
if (superviseCheckRectifyItem != null)
{
Funs.DB.Supervise_SuperviseCheckRectifyItem.DeleteOnSubmit(superviseCheckRectifyItem);
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 根据安全监督检查整改ID删除所有相关明细信息
/// </summary>
/// <param name="superviseCheckRectifyId"></param>
public static void DeleteSuperviseCheckRectifyItemBySuperviseCheckRectifyId(string superviseCheckRectifyId)
{
var q = (from x in Funs.DB.Supervise_SuperviseCheckRectifyItem where x.SuperviseCheckRectifyId == superviseCheckRectifyId select x).ToList();
if (q != null)
{
Funs.DB.Supervise_SuperviseCheckRectifyItem.DeleteAllOnSubmit(q);
Funs.DB.SubmitChanges();
}
}
}
}
@@ -0,0 +1,97 @@
using System.Linq;
namespace BLL
{
/// <summary>
/// 安全监督检查整改
/// </summary>
public static class SuperviseCheckRectifyService
{
/// <summary>
/// 根据主键获取安全监督检查整改
/// </summary>
/// <param name="superviseCheckRectifyId"></param>
/// <returns></returns>
public static Model.Supervise_SuperviseCheckRectify GetSuperviseCheckRectifyById(string superviseCheckRectifyId)
{
return Funs.DB.Supervise_SuperviseCheckRectify.FirstOrDefault(e => e.SuperviseCheckRectifyId == superviseCheckRectifyId);
}
/// <summary>
/// 根据检查报告id获取整改
/// </summary>
/// <param name="superviseCheckReportId"></param>
/// <returns></returns>
public static Model.Supervise_SuperviseCheckRectify GetSuperviseCheckRectifyBySuperviseCheckReportId(string superviseCheckReportId)
{
return Funs.DB.Supervise_SuperviseCheckRectify.FirstOrDefault(e => e.SuperviseCheckReportId == superviseCheckReportId);
}
/// <summary>
/// 添加安全监督检查整改
/// </summary>
/// <param name="SuperviseCheckRectify"></param>
public static void AddSuperviseCheckRectify(Model.Supervise_SuperviseCheckRectify superviseCheckRectify)
{
Model.Supervise_SuperviseCheckRectify newSuperviseCheckRectify = new Model.Supervise_SuperviseCheckRectify
{
SuperviseCheckRectifyId = superviseCheckRectify.SuperviseCheckRectifyId,
SuperviseCheckRectifyCode = superviseCheckRectify.SuperviseCheckRectifyCode,
ProjectId = superviseCheckRectify.ProjectId,
UnitId = superviseCheckRectify.UnitId,
CheckDate = superviseCheckRectify.CheckDate,
IssueMan = superviseCheckRectify.IssueMan,
IssueDate = superviseCheckRectify.IssueDate,
SuperviseCheckReportId = superviseCheckRectify.SuperviseCheckReportId,
HandleState = superviseCheckRectify.HandleState
};
Funs.DB.Supervise_SuperviseCheckRectify.InsertOnSubmit(newSuperviseCheckRectify);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 修改安全监督检查整改
/// </summary>
/// <param name="superviseCheckRectify"></param>
public static void UpdateSuperviseCheckRectify(Model.Supervise_SuperviseCheckRectify superviseCheckRectify)
{
Model.Supervise_SuperviseCheckRectify newSuperviseCheckRectify = Funs.DB.Supervise_SuperviseCheckRectify.FirstOrDefault(e => e.SuperviseCheckRectifyId == superviseCheckRectify.SuperviseCheckRectifyId);
if (newSuperviseCheckRectify != null)
{
newSuperviseCheckRectify.SuperviseCheckRectifyCode = superviseCheckRectify.SuperviseCheckRectifyCode;
newSuperviseCheckRectify.ProjectId = superviseCheckRectify.ProjectId;
newSuperviseCheckRectify.UnitId = superviseCheckRectify.UnitId;
newSuperviseCheckRectify.CheckDate = superviseCheckRectify.CheckDate;
newSuperviseCheckRectify.IssueMan = superviseCheckRectify.IssueMan;
newSuperviseCheckRectify.IssueDate = superviseCheckRectify.IssueDate;
newSuperviseCheckRectify.SuperviseCheckReportId = superviseCheckRectify.SuperviseCheckReportId;
newSuperviseCheckRectify.HandleState = superviseCheckRectify.HandleState;
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除安全监督检查整改
/// </summary>
/// <param name="superviseCheckRectifyId"></param>
public static void DeleteSuperviseCheckRectifyById(string superviseCheckRectifyId)
{
Model.Supervise_SuperviseCheckRectify superviseCheckRectify = Funs.DB.Supervise_SuperviseCheckRectify.FirstOrDefault(e => e.SuperviseCheckRectifyId == superviseCheckRectifyId);
if (superviseCheckRectify != null)
{
var superviseCheckRectifys = from x in Funs.DB.Supervise_SuperviseCheckRectify where x.SuperviseCheckReportId == superviseCheckRectify.SuperviseCheckReportId select x;
if (superviseCheckRectifys.Count() == 1)
{
var report = BLL.SuperviseCheckReportService.GetSuperviseCheckReportById(superviseCheckRectify.SuperviseCheckReportId);
if (report != null)
{
report.IsIssued = null; //已下发
BLL.SuperviseCheckReportService.UpdateSuperviseCheckReport(report);
}
}
Funs.DB.Supervise_SuperviseCheckRectify.DeleteOnSubmit(superviseCheckRectify);
Funs.DB.SubmitChanges();
}
}
}
}
@@ -0,0 +1,90 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
/// <summary>
/// 安全监督检查报告明细表
/// </summary>
public static class SuperviseCheckReportItemService
{
/// <summary>
/// 根据主键获取安全监督检查报告明细信息
/// </summary>
/// <param name="superviseCheckReportItemId"></param>
/// <returns></returns>
public static Model.Supervise_SuperviseCheckReportItem GetSuperviseCheckReportItemById(string superviseCheckReportItemId)
{
return Funs.DB.Supervise_SuperviseCheckReportItem.FirstOrDefault(e => e.SuperviseCheckReportItemId == superviseCheckReportItemId);
}
/// <summary>
/// 根据安全监督检查报告id获取所有相关明细信息
/// </summary>
/// <param name="superviseCheckReportId"></param>
/// <returns></returns>
public static List<Model.Supervise_SuperviseCheckReportItem> GetSuperviseCheckReportItemBySuperviseCheckReportId(string superviseCheckReportId)
{
return (from x in Funs.DB.Supervise_SuperviseCheckReportItem where x.SuperviseCheckReportId == superviseCheckReportId select x).ToList();
}
/// <summary>
/// 根据安全监督检查报告id获取所有选中的相关明细信息
/// </summary>
/// <param name="superviseCheckReportId"></param>
/// <returns></returns>
public static List<Model.Supervise_SuperviseCheckReportItem> GetSelectedSuperviseCheckReportItemBySuperviseCheckReportId(string superviseCheckReportId)
{
return (from x in Funs.DB.Supervise_SuperviseCheckReportItem where x.SuperviseCheckReportId == superviseCheckReportId && x.IsSelected == true select x).ToList();
}
/// <summary>
/// 添加安全监督检查报告明细信息
/// </summary>
/// <param name="superviseCheckReportItem"></param>
public static void AddSuperviseCheckReportItem(Model.Supervise_SuperviseCheckReportItem superviseCheckReportItem)
{
Model.Supervise_SuperviseCheckReportItem newSuperviseCheckReportItem = new Model.Supervise_SuperviseCheckReportItem
{
SuperviseCheckReportItemId = superviseCheckReportItem.SuperviseCheckReportItemId,
SuperviseCheckReportId = superviseCheckReportItem.SuperviseCheckReportId,
RectifyItemId = superviseCheckReportItem.RectifyItemId,
IsSelected = superviseCheckReportItem.IsSelected,
AttachUrl = superviseCheckReportItem.AttachUrl
};
Funs.DB.Supervise_SuperviseCheckReportItem.InsertOnSubmit(newSuperviseCheckReportItem);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 根据主键删除安全监督检查报告明细信息
/// </summary>
/// <param name="superviseCheckReportItemId"></param>
public static void DeleteSuperviseCheckReportItem(string superviseCheckReportItemId)
{
Model.Supervise_SuperviseCheckReportItem superviseCheckReportItem = Funs.DB.Supervise_SuperviseCheckReportItem.FirstOrDefault(e => e.SuperviseCheckReportItemId == superviseCheckReportItemId);
if (superviseCheckReportItem != null)
{
Funs.DB.Supervise_SuperviseCheckReportItem.DeleteOnSubmit(superviseCheckReportItem);
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 根据安全监督检查报告ID删除所有相关明细信息
/// </summary>
/// <param name="superviseCheckReportId"></param>
public static void DeleteSuperviseCheckReportItemBySuperviseCheckReportId(string superviseCheckReportId)
{
var q = (from x in Funs.DB.Supervise_SuperviseCheckReportItem where x.SuperviseCheckReportId == superviseCheckReportId select x).ToList();
if (q != null)
{
Funs.DB.Supervise_SuperviseCheckReportItem.DeleteAllOnSubmit(q);
Funs.DB.SubmitChanges();
}
}
}
}
@@ -0,0 +1,87 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
/// <summary>
/// 安全监督检查报告表
/// </summary>
public static class SuperviseCheckReportService
{
/// <summary>
/// 根据主键获取安全监督检查报告
/// </summary>
/// <param name="superviseCheckReportId"></param>
/// <returns></returns>
public static Model.Supervise_SuperviseCheckReport GetSuperviseCheckReportById(string superviseCheckReportId)
{
return Funs.DB.Supervise_SuperviseCheckReport.FirstOrDefault(e => e.SuperviseCheckReportId == superviseCheckReportId);
}
/// <summary>
/// 添加安全监督检查报告
/// </summary>
/// <param name="superviseCheckReport"></param>
public static void AddSuperviseCheckReport(Model.Supervise_SuperviseCheckReport superviseCheckReport)
{
Model.Supervise_SuperviseCheckReport newSuperviseCheckReport = new Model.Supervise_SuperviseCheckReport
{
SuperviseCheckReportId = superviseCheckReport.SuperviseCheckReportId,
SuperviseCheckReportCode = superviseCheckReport.SuperviseCheckReportCode,
CheckDate = superviseCheckReport.CheckDate,
ProjectId = superviseCheckReport.ProjectId,
UnitId = superviseCheckReport.UnitId,
CheckTeam = superviseCheckReport.CheckTeam,
EvaluationResult = superviseCheckReport.EvaluationResult,
CheckType = superviseCheckReport.CheckType,
AttachUrl = superviseCheckReport.AttachUrl,
IsIssued = superviseCheckReport.IsIssued
};
Funs.DB.Supervise_SuperviseCheckReport.InsertOnSubmit(newSuperviseCheckReport);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 修改安全监督检查报告
/// </summary>
/// <param name="superviseCheckReport"></param>
public static void UpdateSuperviseCheckReport(Model.Supervise_SuperviseCheckReport superviseCheckReport)
{
Model.Supervise_SuperviseCheckReport newSuperviseCheckReport = Funs.DB.Supervise_SuperviseCheckReport.FirstOrDefault(e => e.SuperviseCheckReportId == superviseCheckReport.SuperviseCheckReportId);
if (newSuperviseCheckReport != null)
{
newSuperviseCheckReport.SuperviseCheckReportCode = superviseCheckReport.SuperviseCheckReportCode;
newSuperviseCheckReport.CheckDate = superviseCheckReport.CheckDate;
newSuperviseCheckReport.ProjectId = superviseCheckReport.ProjectId;
newSuperviseCheckReport.UnitId = superviseCheckReport.UnitId;
newSuperviseCheckReport.CheckTeam = superviseCheckReport.CheckTeam;
newSuperviseCheckReport.EvaluationResult = superviseCheckReport.EvaluationResult;
newSuperviseCheckReport.CheckType = superviseCheckReport.CheckType;
newSuperviseCheckReport.AttachUrl = superviseCheckReport.AttachUrl;
newSuperviseCheckReport.IsIssued = superviseCheckReport.IsIssued;
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除安全监督检查报告
/// </summary>
/// <param name="superviseCheckReportId"></param>
public static void DeleteSuperviseCheckReportById(string superviseCheckReportId)
{
Model.Supervise_SuperviseCheckReport superviseCheckReport = Funs.DB.Supervise_SuperviseCheckReport.FirstOrDefault(e => e.SuperviseCheckReportId == superviseCheckReportId);
if (superviseCheckReport != null)
{
if (!string.IsNullOrEmpty(superviseCheckReport.AttachUrl))
{
BLL.UploadFileService.DeleteFile(Funs.RootPath, superviseCheckReport.AttachUrl);//删除附件
}
Funs.DB.Supervise_SuperviseCheckReport.DeleteOnSubmit(superviseCheckReport);
Funs.DB.SubmitChanges();
}
}
}
}