This commit is contained in:
2024-09-03 16:24:17 +08:00
416 changed files with 39470 additions and 4178 deletions
+2 -2
View File
@@ -82,7 +82,7 @@ namespace BLL
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var getDataLists = (from x in db.WBS_UnitWork
where x.ProjectId == projectId && x.SuperUnitWork == null
where x.ProjectId == projectId && x.SuperUnitWork == "0"
orderby x.UnitWorkCode
select new Model.BaseInfoItem
{
@@ -106,7 +106,7 @@ namespace BLL
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var getDataLists = (from x in db.WBS_UnitWork
where x.ProjectId == projectId && x.UnitId == unitId && x.SuperUnitWork == null
where x.ProjectId == projectId && x.UnitId == unitId && (x.SuperUnitWork == null || x.SuperUnitWork == "0")
orderby x.UnitWorkCode
select new Model.BaseInfoItem
{
+6 -1
View File
@@ -337,6 +337,8 @@ namespace BLL
CheckItemDetailContent = x.CheckItemSetContent,
Rectification_Date = string.Format("{0:yyyy-MM-dd}", x.Rectification_Date),
CheckOpinions = x.CheckOpinions,
HiddenType=x.HiddenType
};
return getInfo.ToList();
}
@@ -427,7 +429,8 @@ namespace BLL
CheckItemDetailSetId=x.CheckItemSetId,
CheckItemDetailContent=x.CheckItemSetContent,
Rectification_Date= string.Format("{0:yyyy-MM-dd}", x.Rectification_Date),
CheckOpinions=x.CheckOpinions
CheckOpinions=x.CheckOpinions,
HiddenType=x.HiddenType
};
return getInfo.First();
}
@@ -468,6 +471,7 @@ namespace BLL
CheckItemSetContent= newDetail.CheckItemDetailContent,
Rectification_Date = Funs.GetNewDateTime(newDetail.Rectification_Date),
CheckOpinions=newDetail.CheckOpinions,
HiddenType=newDetail.HiddenType,
};
if (newCheckSpecialDetail.CompleteStatus == false && newCheckSpecialDetail.HandleStep.Contains("1") && string.IsNullOrEmpty(newCheckSpecialDetail.HiddenHazardType))
{
@@ -515,6 +519,7 @@ namespace BLL
updateDetail.CheckItemSetContent = newDetail.CheckItemDetailContent;
updateDetail.Rectification_Date = Funs.GetNewDateTime(newDetail.Rectification_Date);
updateDetail.CheckOpinions = newDetail.CheckOpinions;
updateDetail.HiddenType = newDetail.HiddenType;
db.SubmitChanges();
}
////保存附件
@@ -80,6 +80,10 @@ namespace BLL
IsWx = "Y",
CCManIds = hazardRegister.CCManIds,
Requirements = hazardRegister.Requirements,
Risk_Level = hazardRegister.Risk_Level,
HiddenType= hazardRegister.HiddenType
};
var RegisterTypesDt = db.HSSE_Hazard_HazardRegisterTypes.FirstOrDefault(x => x.RegisterTypesId == newHazardRegister.RegisterTypesId);
if (RegisterTypesDt != null && RegisterTypesDt.HazardRegisterType == "4")
@@ -173,6 +177,7 @@ namespace BLL
ResponsibilityManName = db.Sys_User.First(User => x.ResponsibleMan == User.UserId).UserName,
RectificationTime = x.RectificationTime,
Risk_Level = x.Risk_Level,
HiddenType=x.HiddenType
}).OrderBy(x => x.CheckTime).Skip(Funs.PageSize * (pageIndex - 1)).Take(Funs.PageSize).ToList();
return hazardRegisters;
@@ -107,6 +107,9 @@ namespace BLL
IsRectify = x.IsRectify,
PhotoBeforeUrl = APIUpLoadFileService.getFileUrl(x.RectifyNoticesItemId + "#1", null),
PhotoAfterUrl = APIUpLoadFileService.getFileUrl(x.RectifyNoticesItemId + "#2", null),
HiddenType=x.HiddenType,
HiddenHazardType=x.HiddenHazardType
};
return getInfo.ToList();
}
@@ -473,6 +476,9 @@ namespace BLL
LimitTime = Funs.GetNewDateTime(rItem.LimitTime),
RectifyResults = null,
IsRectify = null,
HiddenType=rItem.HiddenType,
HiddenHazardType=rItem.HiddenHazardType
};
db.Check_RectifyNoticesItem.InsertOnSubmit(newItem);
db.SubmitChanges();
+4 -8
View File
@@ -54,9 +54,9 @@
<Reference Include="Microsoft.QualityTools.Testing.Fakes, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="Microsoft.SQLServer.ManagedDTS, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<Reference Include="Microsoft.SQLServer.ManagedDTS, Version=16.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Lib\Microsoft.SQLServer.ManagedDTS.dll</HintPath>
<HintPath>C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SqlServer.ManagedDTS\v4.0_16.0.0.0__89845dcd8080cc91\新建文件夹\Microsoft.SQLServer.ManagedDTS.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
@@ -397,7 +397,9 @@
<Compile Include="HSSE\CostGoods\CostManageService.cs" />
<Compile Include="HSSE\CostGoods\CostSmallDetailItemService.cs" />
<Compile Include="HSSE\CostGoods\CostSmallDetailService.cs" />
<Compile Include="HSSE\CostGoods\FeeRegistration.cs" />
<Compile Include="HSSE\CostGoods\GoodsManageService.cs" />
<Compile Include="HSSE\CostGoods\HseExpenseService.cs" />
<Compile Include="HSSE\EduTrain\AccidentCaseItemService.cs" />
<Compile Include="HSSE\EduTrain\AccidentCaseService.cs" />
<Compile Include="HSSE\EduTrain\CompanyTrainingItemService.cs" />
@@ -614,12 +616,6 @@
<Compile Include="JDGL\WBS\WbsSetService.cs" />
<Compile Include="JDGL\WBS\WorkloadStatisticsService.cs" />
<Compile Include="Notice\NoticeService.cs" />
<Compile Include="obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs" />
<Compile Include="obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs" />
<Compile Include="obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs" />
<Compile Include="obj\Release\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs" />
<Compile Include="obj\Release\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs" />
<Compile Include="obj\Release\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs" />
<Compile Include="OfficeCheck\Check\CheckNoticeService.cs" />
<Compile Include="OfficeCheck\Check\CheckReportService.cs" />
<Compile Include="OfficeCheck\Check\CheckTable1Service.cs" />
+10
View File
@@ -22,6 +22,16 @@ namespace BLL
return Funs.DB.Base_RiskLevel.FirstOrDefault(e => e.RiskLevelId == riskLevelId);
}
/// <summary>
/// 根据主键获取许可证类型
/// </summary>
/// <param name="licenseTypeId"></param>
/// <returns></returns>
public static Model.Base_RiskLevel GetRiskLevelBy(string riskLevel)
{
return Funs.DB.Base_RiskLevel.FirstOrDefault(e => e.RiskLevel == Convert.ToInt32(riskLevel));
}
/// <summary>
/// 添加许可证类型
/// </summary>
+29 -29
View File
@@ -125,7 +125,7 @@ namespace BLL
if (type == "0")
{
//isOk = AddPerson(projectId, arr, sysUser);
isOk = AddPerson(projectId, arr, sysUser);
}
else if (type == "1")
{
@@ -216,7 +216,7 @@ namespace BLL
try
{
List<Model.Bo_Sheng_Person> insertPersons = new List<Model.Bo_Sheng_Person>();
List<Model.SitePerson_Person> insertSitePersons = new List<Model.SitePerson_Person>();
//List<Model.SitePerson_Person> insertSitePersons = new List<Model.SitePerson_Person>();
foreach (var item in arr)
{
string getID = item["ID"].ToString();
@@ -292,39 +292,39 @@ namespace BLL
db.SubmitChanges();
}
}
var getSitePerson = db.SitePerson_Person.FirstOrDefault(x => x.IdentityCard == item["IdentifyID"].ToString());
if (!string.IsNullOrEmpty(getID))
{
if (getSitePerson == null)
{
Model.SitePerson_Person newPerson = new Model.SitePerson_Person
{
PersonId = SQLHelper.GetNewID(),
ProjectId = projectId,
PersonName = item["Name"].ToString(),
Sex = item["Sex"].ToString(),
Birthday = Funs.GetNewDateTime(item["BirthDay"].ToString()),
Address = item["Address"].ToString(),
Nation = item["Nation"].ToString(),
IdentityCard = item["IdentifyID"].ToString(),
UnitId = BLL.UnitService.GetUnitIdByUnitName(item["DepartName"].ToString()),
Telephone = item["Telephone"].ToString(),
MaritalStatus = item["MaritalStatus"].ToString(),
};
insertSitePersons.Add(newPerson);
}
}
//var getSitePerson = db.SitePerson_Person.FirstOrDefault(x => x.IdentityCard == item["IdentifyID"].ToString());
//if (!string.IsNullOrEmpty(getID))
//{
// if (getSitePerson == null)
// {
// Model.SitePerson_Person newPerson = new Model.SitePerson_Person
// {
// PersonId = SQLHelper.GetNewID(),
// ProjectId = projectId,
// PersonName = item["Name"].ToString(),
// Sex = item["Sex"].ToString(),
// Birthday = Funs.GetNewDateTime(item["BirthDay"].ToString()),
// Address = item["Address"].ToString(),
// Nation = item["Nation"].ToString(),
// IdentityCard = item["IdentifyID"].ToString(),
// UnitId = BLL.UnitService.GetUnitIdByUnitName(item["DepartName"].ToString()),
// Telephone = item["Telephone"].ToString(),
// MaritalStatus = item["MaritalStatus"].ToString(),
// };
// insertSitePersons.Add(newPerson);
// }
//}
if (insertPersons.Count() > 0)
{
db.Bo_Sheng_Person.InsertAllOnSubmit(insertPersons);
db.SubmitChanges();
}
if (insertSitePersons.Count() > 0)
{
db.SitePerson_Person.InsertAllOnSubmit(insertSitePersons);
db.SubmitChanges();
}
//if (insertSitePersons.Count() > 0)
//{
// db.SitePerson_Person.InsertAllOnSubmit(insertSitePersons);
// db.SubmitChanges();
//}
}
}
catch (Exception ex)
@@ -139,29 +139,31 @@ namespace BLL
/// <param name="inspectionMachine"></param>
public static void UpdateInspectionMachine(Model.Comprehensive_InspectionMachine inspectionMachine)
{
Model.SGGLDB db = Funs.DB;
Model.Comprehensive_InspectionMachine newInspectionMachine = db.Comprehensive_InspectionMachine.FirstOrDefault(e => e.InspectionMachineId == inspectionMachine.InspectionMachineId);
if (newInspectionMachine != null)
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
newInspectionMachine.ProjectId = inspectionMachine.ProjectId;
newInspectionMachine.UnitId = inspectionMachine.UnitId;
newInspectionMachine.InspectionMachineCode = inspectionMachine.InspectionMachineCode;
newInspectionMachine.InspectionMachineName = inspectionMachine.InspectionMachineName;
newInspectionMachine.SpecificationModel = inspectionMachine.SpecificationModel;
newInspectionMachine.IsCheckOK = inspectionMachine.IsCheckOK;
newInspectionMachine.InspectionType = inspectionMachine.InspectionType;
newInspectionMachine.NextTestDate = inspectionMachine.NextTestDate;
newInspectionMachine.TestCycle = inspectionMachine.TestCycle;
newInspectionMachine.IsVerification = inspectionMachine.IsVerification;
newInspectionMachine.InspectionDate = inspectionMachine.InspectionDate;
newInspectionMachine.AttachUrl = inspectionMachine.AttachUrl;
newInspectionMachine.CNProfessionalId = inspectionMachine.CNProfessionalId;
newInspectionMachine.IsOnSite = inspectionMachine.IsOnSite;
newInspectionMachine.UnitsCount = inspectionMachine.UnitsCount;
newInspectionMachine.LeaveDate = inspectionMachine.LeaveDate;
newInspectionMachine.Status = inspectionMachine.Status;
newInspectionMachine.RemarkCode = inspectionMachine.RemarkCode;
db.SubmitChanges();
Model.Comprehensive_InspectionMachine newInspectionMachine = db.Comprehensive_InspectionMachine.FirstOrDefault(e => e.InspectionMachineId == inspectionMachine.InspectionMachineId);
if (newInspectionMachine != null)
{
newInspectionMachine.ProjectId = inspectionMachine.ProjectId;
newInspectionMachine.UnitId = inspectionMachine.UnitId;
newInspectionMachine.InspectionMachineCode = inspectionMachine.InspectionMachineCode;
newInspectionMachine.InspectionMachineName = inspectionMachine.InspectionMachineName;
newInspectionMachine.SpecificationModel = inspectionMachine.SpecificationModel;
newInspectionMachine.IsCheckOK = inspectionMachine.IsCheckOK;
newInspectionMachine.InspectionType = inspectionMachine.InspectionType;
newInspectionMachine.NextTestDate = inspectionMachine.NextTestDate;
newInspectionMachine.TestCycle = inspectionMachine.TestCycle;
newInspectionMachine.IsVerification = inspectionMachine.IsVerification;
newInspectionMachine.InspectionDate = inspectionMachine.InspectionDate;
newInspectionMachine.AttachUrl = inspectionMachine.AttachUrl;
newInspectionMachine.CNProfessionalId = inspectionMachine.CNProfessionalId;
newInspectionMachine.IsOnSite = inspectionMachine.IsOnSite;
newInspectionMachine.UnitsCount = inspectionMachine.UnitsCount;
newInspectionMachine.LeaveDate = inspectionMachine.LeaveDate;
newInspectionMachine.Status = inspectionMachine.Status;
newInspectionMachine.RemarkCode = inspectionMachine.RemarkCode;
db.SubmitChanges();
}
}
}
@@ -119,6 +119,7 @@ namespace BLL
newNCRManagement.Problem = nCRManagement.Problem;
newNCRManagement.Measure = nCRManagement.Measure;
newNCRManagement.RemarkCode = nCRManagement.RemarkCode;
newNCRManagement.Supervisor = nCRManagement.Supervisor;
db.Comprehensive_NCRManagement.InsertOnSubmit(newNCRManagement);
db.SubmitChanges();
}
@@ -150,6 +151,7 @@ namespace BLL
newNCRManagement.Problem = nCRManagement.Problem;
newNCRManagement.Measure = nCRManagement.Measure;
newNCRManagement.RemarkCode = nCRManagement.RemarkCode;
newNCRManagement.Supervisor = nCRManagement.Supervisor;
db.SubmitChanges();
}
}
@@ -453,5 +453,30 @@ namespace BLL
return InspectionMangementList;
}
public static List<Model.View_MonthReport_InspectionManagement> getViewMonthReportInspectionManagementByCNProfessionalIdAndDate(string projectId, string cNProfessionalId, DateTime startDate, DateTime SoptDate, bool isOnceQualified)
{
List<Model.View_MonthReport_InspectionManagement> InspectionMangementList = (from x in Funs.DB.View_MonthReport_InspectionManagement select x).ToList();
if (!string.IsNullOrEmpty(projectId))
{
InspectionMangementList = (from x in InspectionMangementList where x.ProjectId == projectId select x).ToList();
}
if (!string.IsNullOrEmpty(cNProfessionalId) && cNProfessionalId != "0")
{
InspectionMangementList = (from x in InspectionMangementList where x.CNProfessionalId == cNProfessionalId select x).ToList();
}
if (isOnceQualified == true)
{
InspectionMangementList = (from x in InspectionMangementList where x.IsOnceQualified == isOnceQualified select x).ToList();
}
if (startDate != null && SoptDate != null)
{
InspectionMangementList = (from x in InspectionMangementList where x.InspectionDate >= startDate && x.InspectionDate <= SoptDate select x).ToList();
}
return InspectionMangementList;
}
}
}
+26
View File
@@ -2279,6 +2279,11 @@ namespace BLL
/// 安全费用管理
/// </summary>
public const string ProjectHSSECostManageMenuId = "5C74F09D-FDE3-4995-A1D6-0549A8693940";
/// <summary>
/// 合同HSE费用额登记
/// </summary>
public const string FeeRegistrationMenuId = "C6CF3A5C-546B-483A-B742-A77F2E152523";
#endregion
#region HSSE行政管理
@@ -3354,6 +3359,11 @@ namespace BLL
/// </summary>
public const string ConExperienceSummaryTemUrl = "File\\Excel\\DataIn\\类似项目施工经验总结清单导入模板.xls";
/// <summary>
/// 新项目安全月报模板文件原始虚拟路径
/// </summary>
public const string HseMonthReportNewTemplateUrl = "File\\Word\\HSSE\\项目安全月报.doc";
#region
/// <summary>
/// 质量专项检查模板文件原始虚拟路径
@@ -4298,6 +4308,9 @@ namespace BLL
public const string PlumbingMenuId = "95295BF7-FB51-480D-9902-6ADA4E8427FC";
public const string HVACMenuId = "05442049-1310-45B1-9D3D-CAAE759D8F3E";
public const string PunchlistFromMenuId = "016903B1-3B86-4CF5-AFF8-FF8BE389BEE5";
public const string Transfer_LHCSystemListMenuId0 = "197F9A9A-480C-4CC3-B6B7-3A7D382DC3EB";
public const string Transfer_LHCSystemListMenuId1 = "022428DC-FC99-4916-B8AF-6A9DC885DFAF";
#endregion
#endregion
@@ -4726,6 +4739,14 @@ namespace BLL
/// 开车人员月绩效报告模板文件原始虚拟路径
/// </summary>
public const string TestRunPerformanceMonthReportTemplateUrl = "File\\Excel\\DataOut\\开车人员月绩效报告.xlsx";
/// <summary>
/// 月度计划情况模板文件原始虚拟路径
/// </summary>
public const string MonthPlanOutTemplateUrl = "File\\Excel\\DataOut\\月度计划情况.xlsx";
/// <summary>
/// 周进度计划模板文件原始虚拟路径
/// </summary>
public const string WeekPlanOutTemplateUrl = "File\\Excel\\DataOut\\周进度计划.xlsx";
#endregion
#endregion
@@ -6045,5 +6066,10 @@ namespace BLL
/// 检查表尾项管理
/// </summary>
public const string InspectTailTerm = "B6A6EA7D-EDAB-40C8-920D-A106731D0E08";
/// <summary>
/// HSSE管理月报新
/// </summary>
public const string ManagerMonthCNewMenuId = "9E4B28DF-8C8E-49F8-AB15-270BBDC73449";
}
}
+13
View File
@@ -423,5 +423,18 @@ namespace BLL
}
}
public static List<Model.DropDownItem> getHiddenTypeList(string groupid)
{
var list = (from x in Funs.DB.Sys_Const
where x.GroupId== groupid
orderby x.SortIndex
select new Model.DropDownItem
{
Text = x.ConstText,
Values = x.ConstValue
}).ToList();
return list;
}
}
}
@@ -0,0 +1,94 @@
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
/// <summary>
/// 合同HSE费用额登记
/// </summary>
public class FeeRegistration
{
public static bool Insert(Model.CostGoods_FeeRegistration model)
{
try
{
Funs.DB.CostGoods_FeeRegistration.InsertOnSubmit(model);
Funs.DB.SubmitChanges();
return true;
}
catch (Exception ex)
{
ErrLogInfo.WriteLog($"插入数据失败,原因:{ex.Message}");
return false;
}
}
public static bool Update(Model.CostGoods_FeeRegistration model)
{
try
{
var result = Funs.DB.CostGoods_FeeRegistration.FirstOrDefault(a => a.Id == model.Id);
if (result != null)
{
result.UnitId = model.UnitId;
result.Cost = model.Cost;
Funs.DB.SubmitChanges();
}
return true;
}
catch (Exception ex)
{
ErrLogInfo.WriteLog($"更新表数据失败,原因:{ex.Message}");
return false;
}
}
public static bool Delete(List<string> newId)
{
try
{
var result = Funs.DB.CostGoods_FeeRegistration.Where(a => newId.Contains(a.Id)).ToList();
if (result.Count > 0)
{
Funs.DB.CostGoods_FeeRegistration.DeleteAllOnSubmit(result);
Funs.DB.SubmitChanges();
}
return true;
}
catch (Exception ex)
{
ErrLogInfo.WriteLog($"删除数据失败,原因:{ex.Message}");
return false;
}
}
public static bool Delete(string newId)
{
try
{
var result = Funs.DB.CostGoods_FeeRegistration.Where(a => a.Id == newId).ToList();
if (result.Count > 0)
{
Funs.DB.CostGoods_FeeRegistration.DeleteAllOnSubmit(result);
Funs.DB.SubmitChanges();
}
return true;
}
catch (Exception ex)
{
ErrLogInfo.WriteLog($"删除数据失败,原因:{ex.Message}");
return false;
}
}
public static Model.CostGoods_FeeRegistration Detail(string newId)
{
var result = Funs.DB.CostGoods_FeeRegistration.FirstOrDefault(a => a.Id == newId);
return result;
}
}
}
@@ -0,0 +1,134 @@
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
/// <summary>
/// HSE费用登记(新)
/// </summary>
public class HseExpenseService
{
public static bool Insert(Model.CostGoods_HseExpense model)
{
try
{
Funs.DB.CostGoods_HseExpense.InsertOnSubmit(model);
Funs.DB.SubmitChanges();
return true;
}
catch (Exception ex)
{
ErrLogInfo.WriteLog($"插入数据失败,原因:{ex.Message}");
return false;
}
}
public static bool Update(Model.CostGoods_HseExpense model)
{
try
{
var result = Funs.DB.CostGoods_HseExpense.FirstOrDefault(a => a.Id == model.Id);
if (result != null)
{
result.UnitId = model.UnitId;
result.PayDate = model.PayDate;
result.PayMonth = model.PayMonth;
result.SMonthType1 = model.SMonthType1;
result.SMonthType2 = model.SMonthType2;
result.SMonthType3 = model.SMonthType3;
result.SMonthType4 = model.SMonthType4;
result.SMonthType5 = model.SMonthType5;
result.SMonthType6 = model.SMonthType6;
result.SMonthType7 = model.SMonthType7;
result.SMonthType8 = model.SMonthType8;
result.SMonthType9 = model.SMonthType9;
result.SMonthType10 = model.SMonthType10;
Funs.DB.SubmitChanges();
}
return true;
}
catch (Exception ex)
{
ErrLogInfo.WriteLog($"更新表数据失败,原因:{ex.Message}");
return false;
}
}
public static bool Delete(List<string> newId)
{
try
{
var result = Funs.DB.CostGoods_HseExpense.Where(a => newId.Contains(a.Id)).ToList();
if (result.Count > 0)
{
Funs.DB.CostGoods_HseExpense.DeleteAllOnSubmit(result);
Funs.DB.SubmitChanges();
}
return true;
}
catch (Exception ex)
{
ErrLogInfo.WriteLog($"删除数据失败,原因:{ex.Message}");
return false;
}
}
public static bool Delete(string newId)
{
try
{
var result = Funs.DB.CostGoods_HseExpense.Where(a => a.Id == newId).ToList();
if (result.Count > 0)
{
Funs.DB.CostGoods_HseExpense.DeleteAllOnSubmit(result);
Funs.DB.SubmitChanges();
}
return true;
}
catch (Exception ex)
{
ErrLogInfo.WriteLog($"删除数据失败,原因:{ex.Message}");
return false;
}
}
public static Model.CostGoods_HseExpense Detail(string newId)
{
var result = Funs.DB.CostGoods_HseExpense.FirstOrDefault(a => a.Id == newId);
return result;
}
/// <summary>
/// 根据时间、项目获取五环安全费用投入登记信息
/// </summary>
/// <param name="startTime"></param>
/// <param name="endTime"></param>
/// <param name="projectId"></param>
/// <returns></returns>
public static List<Model.CostGoods_HseExpense> GetPayRegistrationByPayDate(DateTime startTime, DateTime endTime, string projectId, string unitId)
{
return (from x in Funs.DB.CostGoods_HseExpense where x.PayDate >= startTime && x.PayDate <= endTime && x.ProjectId == projectId && x.UnitId == unitId select x).ToList();
}
/// <summary>
/// 根据时间、项目获取施工分包商安全费用投入登记信息
/// </summary>
/// <param name="startTime"></param>
/// <param name="endTime"></param>
/// <param name="projectId"></param>
/// <returns></returns>
public static List<Model.CostGoods_HseExpense> GetConPayRegistrationByPayDate(DateTime startTime, DateTime endTime, string projectId)
{
return (from x in Funs.DB.CostGoods_HseExpense
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
where x.PayDate >= startTime && x.PayDate <= endTime && x.ProjectId == projectId
&& y.UnitTypeId == BLL.Const.UnitId_Con
select x).ToList();
}
}
}
@@ -159,5 +159,15 @@ namespace BLL
{
return (from x in Funs.DB.EduTrain_TrainRecord where x.TrainStartDate >= startTime && x.TrainStartDate <= endTime && x.ProjectId == projectId select x.TrainPersonNum).Sum();
}
public static List<Model.EduTrain_TrainRecord> GetTrainingsByTrainDate(DateTime endTime, string projectId)
{
return (from x in Funs.DB.EduTrain_TrainRecord where x.TrainStartDate <= endTime && x.ProjectId == projectId select x).ToList();
}
public static int? GetTrainPersonCount(DateTime endTime, string projectId)
{
return (from x in Funs.DB.EduTrain_TrainRecord where x.TrainStartDate <= endTime && x.ProjectId == projectId select x.TrainPersonNum).Sum();
}
}
}
@@ -70,6 +70,8 @@ namespace BLL
newHazardRegister.DIC_ID = hazardRegister.DIC_ID;
newHazardRegister.Risk_Level = hazardRegister.Risk_Level;
newHazardRegister.Type=hazardRegister.Type;
newHazardRegister.HiddenType = hazardRegister.HiddenType;
db.HSSE_Hazard_HazardRegister.InsertOnSubmit(newHazardRegister);
db.SubmitChanges();
}
@@ -112,6 +114,7 @@ namespace BLL
newHazardRegister.DIC_ID = hazardRegister.DIC_ID;
newHazardRegister.Type = hazardRegister.Type;
newHazardRegister.HiddenType = hazardRegister.HiddenType;
//把附件表的路径复制过来
Model.AttachFile file = BLL.AttachFileService.GetAttachFile(hazardRegister.HazardRegisterId, Const.HSSE_HiddenRectificationListMenuId);
if (file != null)
@@ -90,8 +90,12 @@ namespace BLL
public static void DeleteAccidentSortsByMonthReportId(string monthReportId)
{
var q = (from x in db.Manager_AccidentSortC where x.MonthReportId == monthReportId select x).ToList();
db.Manager_AccidentSortC.DeleteAllOnSubmit(q);
db.SubmitChanges();
if (q.Count>0)
{
db.Manager_AccidentSortC.DeleteAllOnSubmit(q);
db.SubmitChanges();
}
}
}
}
@@ -54,8 +54,12 @@ namespace BLL
public static void DeleteCheckDetailSortsByMonthReportId(string monthReportId)
{
var q = (from x in db.Manager_CheckDetailSortC where x.MonthReportId == monthReportId select x).ToList();
db.Manager_CheckDetailSortC.DeleteAllOnSubmit(q);
db.SubmitChanges();
if (q.Count>0)
{
db.Manager_CheckDetailSortC.DeleteAllOnSubmit(q);
db.SubmitChanges();
}
}
}
}
@@ -49,8 +49,10 @@ namespace BLL
public static void DeleteDrillSortsByMonthReportId(string monthReportId)
{
var q = (from x in db.Manager_DrillSortC where x.MonthReportId == monthReportId select x).ToList();
db.Manager_DrillSortC.DeleteAllOnSubmit(q);
db.SubmitChanges();
if (q.Count > 0) {
db.Manager_DrillSortC.DeleteAllOnSubmit(q);
db.SubmitChanges();
}
}
}
}
@@ -49,8 +49,9 @@ namespace BLL
public static void DeleteEmergencySortsByMonthReportId(string monthReportId)
{
var q = (from x in db.Manager_EmergencySortC where x.MonthReportId == monthReportId select x).ToList();
db.Manager_EmergencySortC.DeleteAllOnSubmit(q);
db.SubmitChanges();
if (q.Count > 0) {
db.Manager_EmergencySortC.DeleteAllOnSubmit(q);
db.SubmitChanges();}
}
}
}
@@ -49,8 +49,13 @@ namespace BLL
public static void DeleteHazardSortsByMonthReportId(string monthReportId)
{
var q = (from x in db.Manager_HazardSortC where x.MonthReportId == monthReportId select x).ToList();
db.Manager_HazardSortC.DeleteAllOnSubmit(q);
db.SubmitChanges();
if (q.Count>0)
{
db.Manager_HazardSortC.DeleteAllOnSubmit(q);
db.SubmitChanges();
}
}
}
}
@@ -78,8 +78,11 @@ namespace BLL
public static void DeleteHseCostsByMonthReportId(string monthReportId)
{
var q = (from x in db.Manager_HseCostC where x.MonthReportId == monthReportId select x).ToList();
db.Manager_HseCostC.DeleteAllOnSubmit(q);
db.SubmitChanges();
if (q.Count>0)
{
db.Manager_HseCostC.DeleteAllOnSubmit(q);
db.SubmitChanges();
}
}
}
}
@@ -68,8 +68,11 @@ namespace BLL
public static void DeleteIncentiveSortsByMonthReportId(string monthReportId)
{
var q = (from x in db.Manager_IncentiveSortC where x.MonthReportId == monthReportId select x).ToList();
db.Manager_IncentiveSortC.DeleteAllOnSubmit(q);
db.SubmitChanges();
if (q.Count > 0)
{
db.Manager_IncentiveSortC.DeleteAllOnSubmit(q);
db.SubmitChanges();
}
}
}
}
@@ -56,8 +56,12 @@ namespace BLL
public static void DeleteMeetingSortsByMonthReportId(string monthReportId)
{
var q = (from x in db.Manager_MeetingSortC where x.MonthReportId == monthReportId select x).ToList();
db.Manager_MeetingSortC.DeleteAllOnSubmit(q);
db.SubmitChanges();
if (q.Count>0)
{
db.Manager_MeetingSortC.DeleteAllOnSubmit(q);
db.SubmitChanges();
}
}
}
}
@@ -227,6 +227,21 @@ namespace BLL
Question = monthReport.Question,
SubcontractManHours = monthReport.SubcontractManHours,
AccidentDef = monthReport.AccidentDef,
StartDate=monthReport.StartDate,
EndDate=monthReport.EndDate,
TotalHseManhoursYear = monthReport.TotalHseManhoursYear,
EmergencyManagementWorkDef=monthReport.EmergencyManagementWorkDef,
MonthHdangerCount=monthReport.MonthHdangerCount,
YearHdangerCount=monthReport.YearHdangerCount,
MonthExpertCount=monthReport.MonthExpertCount,
MonthExpertNoCount=monthReport.MonthExpertNoCount,
Goalach1=monthReport.Goalach1,
Goalach2=monthReport.Goalach2,
Goalach3=monthReport.Goalach3,
MonthReportType=monthReport.MonthReportType
};
db.Manager_MonthReportC.InsertOnSubmit(newMonthReport);
@@ -245,7 +260,7 @@ namespace BLL
Model.Manager_MonthReportC newMonthReport = db.Manager_MonthReportC.First(e => e.MonthReportId == monthReport.MonthReportId);
newMonthReport.MonthReportCode = monthReport.MonthReportCode;
newMonthReport.ProjectId = monthReport.ProjectId;
newMonthReport.Months = monthReport.Months;
//newMonthReport.Months = monthReport.Months;
newMonthReport.MonthReportDate = monthReport.MonthReportDate;
newMonthReport.ReportMan = monthReport.ReportMan;
newMonthReport.HseManhours = monthReport.HseManhours;
@@ -298,6 +313,19 @@ namespace BLL
newMonthReport.SubcontractManHours = monthReport.SubcontractManHours;
newMonthReport.AccidentDef = monthReport.AccidentDef;
newMonthReport.StartDate = monthReport.StartDate;
newMonthReport.EndDate = monthReport.EndDate;
newMonthReport.TotalHseManhoursYear = monthReport.TotalHseManhoursYear;
newMonthReport.EmergencyManagementWorkDef = monthReport.EmergencyManagementWorkDef;
newMonthReport.MonthHdangerCount = monthReport.MonthHdangerCount;
newMonthReport.YearHdangerCount = monthReport.YearHdangerCount;
newMonthReport.MonthExpertCount = monthReport.MonthExpertCount;
newMonthReport.MonthExpertNoCount = monthReport.MonthExpertNoCount;
newMonthReport.Goalach1 = monthReport.Goalach1;
newMonthReport.Goalach2 = monthReport.Goalach2;
newMonthReport.Goalach3 = monthReport.Goalach3;
newMonthReport.MonthReportType = monthReport.MonthReportType;
db.SubmitChanges();
}
@@ -315,5 +343,31 @@ namespace BLL
db.Manager_MonthReportC.DeleteOnSubmit(monthReport);
db.SubmitChanges();
}
#region 4.6.1
public static void AddManager_EmergencyPlan(Model.Manager_EmergencyPlan model) {
Model.SGGLDB db = Funs.DB;
db.Manager_EmergencyPlan.InsertOnSubmit(model);
db.SubmitChanges();
}
#endregion
#region 4.6.2
public static void AddManager_DrillRecordList(Model.Manager_DrillRecordList model)
{
Model.SGGLDB db = Funs.DB;
db.Manager_DrillRecordList.InsertOnSubmit(model);
db.SubmitChanges();
}
#endregion
#region 6.1
public static void AddManager_Attempted(Model.Manager_Attempted model)
{
Model.SGGLDB db = Funs.DB;
db.Manager_Attempted.InsertOnSubmit(model);
db.SubmitChanges();
}
#endregion
}
}
@@ -48,8 +48,11 @@ namespace BLL
public static void DeleteOtherActiveSortsByMonthReportId(string monthReportId)
{
var q = (from x in db.Manager_OtherActiveSortC where x.MonthReportId == monthReportId select x).ToList();
db.Manager_OtherActiveSortC.DeleteAllOnSubmit(q);
db.SubmitChanges();
if (q.Count > 0)
{
db.Manager_OtherActiveSortC.DeleteAllOnSubmit(q);
db.SubmitChanges();
}
}
}
}
@@ -58,5 +58,77 @@ namespace BLL
db.Manager_PersonSortC.DeleteAllOnSubmit(q);
db.SubmitChanges();
}
/// <summary>
/// 根据月报告主键删除对应的所有月报告HSE人力投入信息
/// </summary>
/// <param name="monthReportId">月报告主键</param>
public static void DeleteManager_HiddenDanger(string monthReportId)
{
var q = (from x in db.Manager_HiddenDanger where x.MonthReportId == monthReportId select x).ToList();
if (q.Count>0)
{
db.Manager_HiddenDanger.DeleteAllOnSubmit(q);
db.SubmitChanges();
}
}
/// <summary>
/// 删除月报项目作业许可管理数据
/// </summary>
/// <param name="monthReportId"></param>
public static void DeleteManager_ProjectAssignment(string monthReportId)
{
var q = (from x in db.Manager_ProjectAssignment where x.MonthReportId == monthReportId select x).ToList();
if (q.Count > 0)
{
db.Manager_ProjectAssignment.DeleteAllOnSubmit(q);
db.SubmitChanges();
}
}
/// <summary>
/// 删除月报应急预案发布情况
/// </summary>
/// <param name="monthReportId"></param>
public static void DeleteManager_EmergencyPlan(string monthReportId)
{
var q = (from x in db.Manager_EmergencyPlan where x.MonthReportId == monthReportId select x).ToList();
if (q.Count > 0)
{
db.Manager_EmergencyPlan.DeleteAllOnSubmit(q);
db.SubmitChanges();
}
}
/// <summary>
/// 删除月报应急演练工作情况说明
/// </summary>
/// <param name="monthReportId"></param>
public static void DeleteManager_DrillRecordList(string monthReportId)
{
var q = (from x in db.Manager_DrillRecordList where x.MonthReportId == monthReportId select x).ToList();
if (q.Count > 0)
{
db.Manager_DrillRecordList.DeleteAllOnSubmit(q);
db.SubmitChanges();
}
}
/// <summary>
/// 删除月报未遂事件
/// </summary>
/// <param name="monthReportId"></param>
public static void DeleteManager_Attempted(string monthReportId)
{
var q = (from x in db.Manager_Attempted where x.MonthReportId == monthReportId select x).ToList();
if (q.Count > 0)
{
db.Manager_Attempted.DeleteAllOnSubmit(q);
db.SubmitChanges();
}
}
}
}
@@ -49,8 +49,12 @@ namespace BLL
public static void DeletePromotionalActiviteSortsByMonthReportId(string monthReportId)
{
var q = (from x in db.Manager_PromotionalActiviteSortC where x.MonthReportId == monthReportId select x).ToList();
db.Manager_PromotionalActiviteSortC.DeleteAllOnSubmit(q);
db.SubmitChanges();
if (q.Count>0)
{
db.Manager_PromotionalActiviteSortC.DeleteAllOnSubmit(q);
db.SubmitChanges();
}
}
}
}
@@ -48,8 +48,12 @@ namespace BLL
public static void DeleteTrainActivitySortsByMonthReportId(string monthReportId)
{
var q = (from x in db.Manager_TrainActivitySortC where x.MonthReportId == monthReportId select x).ToList();
db.Manager_TrainActivitySortC.DeleteAllOnSubmit(q);
db.SubmitChanges();
if (q.Count>0)
{
db.Manager_TrainActivitySortC.DeleteAllOnSubmit(q);
db.SubmitChanges();
}
}
}
}
@@ -51,9 +51,20 @@ namespace BLL
/// <param name="monthReportId">月报告主键</param>
public static void DeleteTrainSortsByMonthReportId(string monthReportId)
{
var q = (from x in db.Manager_TrainSortC where x.MonthReportId == monthReportId select x).ToList();
db.Manager_TrainSortC.DeleteAllOnSubmit(q);
db.SubmitChanges();
try
{
var q = (from x in Funs.DB.Manager_TrainSortC where x.MonthReportId == monthReportId select x).ToList();
if (q.Count > 0)
{
Funs.DB.Manager_TrainSortC.DeleteAllOnSubmit(q);
Funs.DB.SubmitChanges();
}
}
catch (Exception ex)
{
ErrLogInfo.WriteLog($"删除数据失败,原因:{ex.Message}");
}
}
}
}
@@ -46,6 +46,8 @@ namespace BLL
CompileDate = SafePersonQuality.CompileDate,
AuditDate = SafePersonQuality.AuditDate,
AuditorId = SafePersonQuality.AuditorId,
CertificateId= SafePersonQuality.CertificateId,
};
db.QualityAudit_SafePersonQuality.InsertOnSubmit(newSafePersonQuality);
db.SubmitChanges();
@@ -74,6 +76,8 @@ namespace BLL
newSafePersonQuality.CompileDate = SafePersonQuality.CompileDate;
newSafePersonQuality.AuditDate = SafePersonQuality.AuditDate;
newSafePersonQuality.AuditorId = SafePersonQuality.AuditorId;
newSafePersonQuality.CertificateId = SafePersonQuality.CertificateId;
db.SubmitChanges();
}
}
+10 -1
View File
@@ -122,7 +122,7 @@ namespace BLL
/// <param name="PageSize">每页数量</param>
/// <returns></returns>
public static IEnumerable getListData(string projectId, string unitId, string personName, string identityCard, string treamGroupId, string workPostIds,
bool ckTrain, string postType, bool ckJT, bool ckIdCardInfoNotOK, Grid Grid1)
bool ckTrain, string postType, bool ckJT, bool ckIdCardInfoNotOK, Grid Grid1,bool isBlack=false)
{
IQueryable<Model.View_SitePerson_Person> getPersonList = getPersonLists.Where(x => x.ProjectId == projectId);
if (!string.IsNullOrEmpty(unitId))
@@ -136,6 +136,15 @@ namespace BLL
getPersonList = getPersonList.Where(x => x.UnitId == unitId);
}
}
if (isBlack == false)
{
getPersonList = getPersonList.Where(x => x.IsBlacklist != true || x.IsBlacklist == null);
}
else {
getPersonList = getPersonList.Where(x => x.IsBlacklist == true);
}
if (!string.IsNullOrEmpty(personName))
{
getPersonList = getPersonList.Where(x => x.PersonName.Contains(personName));
+2 -1
View File
@@ -52,6 +52,7 @@ namespace BLL
Remark = MonthPlan.Remark,
CompileMan = MonthPlan.CompileMan,
CompileDate = MonthPlan.CompileDate,
SortIndex = MonthPlan.SortIndex,
};
db.JDGL_MonthPlan.InsertOnSubmit(newMonthPlan);
db.SubmitChanges();
@@ -75,7 +76,7 @@ namespace BLL
newMonthPlan.Remark = MonthPlan.Remark;
newMonthPlan.CompileMan = MonthPlan.CompileMan;
newMonthPlan.CompileDate = MonthPlan.CompileDate;
db.SubmitChanges();
}
}
@@ -276,7 +276,7 @@ namespace BLL
}
else
{
List<Model.WBS_UnitWork> InstallationList = (from x in Funs.DB.WBS_UnitWork where x.ProjectId == projectId select x).ToList();//装置条件为空时获取对应操作表中所有的装置
List<Model.WBS_UnitWork> InstallationList = (from x in Funs.DB.WBS_UnitWork where x.ProjectId == projectId && (x.SuperUnitWork == null || x.SuperUnitWork == "0") select x).ToList();//装置条件为空时获取对应操作表中所有的装置
foreach (Model.WBS_UnitWork item in InstallationList)
{
Model.View_WBSReport InstallationInit = (from x in WBSReportList where x.Id == item.UnitWorkId select x).FirstOrDefault();
@@ -289,7 +289,7 @@ namespace BLL
}
else
{
List<Model.WBS_UnitWork> InstallationList = (from x in Funs.DB.WBS_UnitWork where x.ProjectId==projectId select x).ToList();
List<Model.WBS_UnitWork> InstallationList = (from x in Funs.DB.WBS_UnitWork where x.ProjectId==projectId && (x.SuperUnitWork == null || x.SuperUnitWork == "0") select x).ToList();
foreach (Model.WBS_UnitWork item in InstallationList)
{
Model.View_WBSReport InstallationInit = (from x in WBSReportList where x.Id == item.UnitWorkId select x).FirstOrDefault();
+1 -1
View File
@@ -395,7 +395,7 @@ namespace BLL
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
try
{
{
string miniprogram_state = ConfigurationManager.AppSettings["miniprogram_state"];
if (!string.IsNullOrEmpty(miniprogram_state) && miniprogram_state == "formal")
{
+1 -1
View File
@@ -5,7 +5,7 @@ using System.Linq;
using System.Web.UI.WebControls;
using System.Collections.Generic;
using Newtonsoft.Json.Linq;
using Microsoft.SqlServer.Dts.Runtime;
//using Microsoft.SqlServer.Dts.Runtime;
namespace BLL
{
+48 -12
View File
@@ -245,7 +245,7 @@ namespace BLL
/// <returns></returns>
public static ListItem[] GetUnitWorkList(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();
List<Model.WBS_UnitWork> q = (from x in Funs.DB.WBS_UnitWork where x.ProjectId == projectId && (x.SuperUnitWork == null || x.SuperUnitWork == "0") orderby x.UnitWorkCode select x).ToList();
ListItem[] item = new ListItem[q.Count()];
for (int i = 0; i < q.Count(); i++)
{
@@ -278,11 +278,11 @@ namespace BLL
/// <returns></returns>
public static List<Model.WBS_UnitWork> GetUnitWorkLists(string projectId)
{
return (from x in Funs.DB.WBS_UnitWork where x.ProjectId == projectId && x.SuperUnitWork == null orderby x.UnitWorkCode select x).ToList();
return (from x in Funs.DB.WBS_UnitWork where x.ProjectId == projectId && (x.SuperUnitWork == null || x.SuperUnitWork == "0") orderby x.UnitWorkCode select x).ToList();
}
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();
List<Model.WBS_UnitWork> q = (from x in Funs.DB.WBS_UnitWork where x.ProjectId == projectId && (x.SuperUnitWork == null || x.SuperUnitWork == "0") orderby x.UnitWorkCode select x).ToList();
ListItem[] item = new ListItem[q.Count()];
for (int i = 0; i < q.Count(); i++)
{
@@ -292,7 +292,7 @@ namespace BLL
}
public static ListItem[] GetUnitWork2(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();
List<Model.WBS_UnitWork> q = (from x in Funs.DB.WBS_UnitWork where x.ProjectId == projectId && (x.SuperUnitWork == null || x.SuperUnitWork == "0") orderby x.UnitWorkCode select x).ToList();
ListItem[] item = new ListItem[q.Count()];
for (int i = 0; i < q.Count(); i++)
{
@@ -390,7 +390,7 @@ namespace BLL
public static List<Model.WBS_UnitWork> GetUnitWorkListByPid(string projectId)
{
Model.SGGLDB db = Funs.DB;
List<Model.WBS_UnitWork> q = (from x in db.WBS_UnitWork where x.ProjectId == projectId && x.SuperUnitWork == null orderby x.UnitWorkCode select x).ToList();
List<Model.WBS_UnitWork> q = (from x in db.WBS_UnitWork where x.ProjectId == projectId && (x.SuperUnitWork == null||x.SuperUnitWork=="0") orderby x.UnitWorkCode select x).ToList();
return q;
}
public static Model.WBS_UnitWork getUnitWorkByUnitWorkId(string UnitWorkId)
@@ -402,7 +402,7 @@ namespace BLL
string[] type = null;
if (!string.IsNullOrEmpty(projectType))
type = projectType.Split(',');
var unitWorks = from x in Funs.DB.WBS_UnitWork where x.ProjectId == projectId && (type == null || type.Contains(x.ProjectType)) orderby x.UnitWorkCode select x;
var unitWorks = from x in Funs.DB.WBS_UnitWork where x.ProjectId == projectId && (x.SuperUnitWork == null || x.SuperUnitWork == "0") && (type == null || type.Contains(x.ProjectType)) orderby x.UnitWorkCode select x;
return unitWorks.ToList();
}
/// <summary>
@@ -412,7 +412,7 @@ namespace BLL
/// <returns></returns>
public static ListItem[] GetUnitWorkListByProjectType(string projectId, string projectType)
{
List<Model.WBS_UnitWork> q = (from x in Funs.DB.WBS_UnitWork where x.ProjectId == projectId && x.SuperUnitWork == null && x.ProjectType == projectType orderby x.UnitWorkCode select x).ToList();
List<Model.WBS_UnitWork> q = (from x in Funs.DB.WBS_UnitWork where x.ProjectId == projectId && (x.SuperUnitWork == null||x.SuperUnitWork=="0") && x.ProjectType == projectType orderby x.UnitWorkCode select x).ToList();
ListItem[] item = new ListItem[q.Count()];
for (int i = 0; i < q.Count(); i++)
{
@@ -454,12 +454,12 @@ namespace BLL
{
if (ProjectType == "1")
{
List<Model.WBS_UnitWork> lis = (from x in Funs.DB.WBS_UnitWork where x.ProjectType == "1" && x.ProjectId == ProjectId orderby x.UnitWorkCode select x).ToList();
List<Model.WBS_UnitWork> lis = (from x in Funs.DB.WBS_UnitWork where x.ProjectType == "1" && x.ProjectId == ProjectId && (x.SuperUnitWork == null || x.SuperUnitWork == "0") orderby x.UnitWorkCode select x).ToList();
return lis;
}
else if (ProjectType == "2")
{
List<Model.WBS_UnitWork> lis = (from x in Funs.DB.WBS_UnitWork where x.ProjectType == "2" && x.ProjectId == ProjectId orderby x.UnitWorkCode select x).ToList();
List<Model.WBS_UnitWork> lis = (from x in Funs.DB.WBS_UnitWork where x.ProjectType == "2" && x.ProjectId == ProjectId && (x.SuperUnitWork == null || x.SuperUnitWork == "0") orderby x.UnitWorkCode select x).ToList();
return lis;
}
else
@@ -497,7 +497,7 @@ namespace BLL
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
where x.ProjectId == projectId && (x.SuperUnitWork == null || x.SuperUnitWork == "0")
orderby x.UnitWorkCode
select new
{
@@ -524,7 +524,7 @@ namespace BLL
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
where x.ProjectId == projectId && (x.SuperUnitWork == null || x.SuperUnitWork == "0")
orderby x.UnitWorkCode
select new
{
@@ -550,7 +550,7 @@ namespace BLL
public static string GetUnitWorkALLName(string unitWorkId)
{
string name = string.Empty;
var getu = Funs.DB.WBS_UnitWork.FirstOrDefault(x => x.UnitWorkId == unitWorkId && x.SuperUnitWork == null);
var getu = Funs.DB.WBS_UnitWork.FirstOrDefault(x => x.UnitWorkId == unitWorkId && (x.SuperUnitWork == null || x.SuperUnitWork == "0"));
if (getu != null)
{
if (!string.IsNullOrEmpty(getu.ProjectType))
@@ -636,5 +636,41 @@ namespace BLL
return string.Empty;
}
}
/// <summary>
/// 是否可增加子级
/// </summary>
/// <param name="postName"></param>
/// <returns>true-可以,false-不可以</returns>
public static bool IsCanAddUnitWork(string unitWorkId)
{
var unitWork = Funs.DB.WBS_UnitWork.FirstOrDefault(x => x.UnitWorkId == unitWorkId);
if (unitWork != null)
{
if (unitWork.IsChild == true)
{
return false;
}
else
{
return true;
}
}
else
{
return true;
}
}
/// <summary>
/// 是否存在子级单位工程
/// </summary>
/// <param name="superUnitWork"></param>
/// <returns></returns>
public static bool IsExitsUnitWorkBySuperUnitWork(string superUnitWork)
{
return (from x in Funs.DB.WBS_UnitWork where x.SuperUnitWork == superUnitWork select x).Count() > 0;
}
}
}
@@ -702,7 +702,7 @@ namespace BLL
public static int GetUnitProjectNum(string projectid)
{
int result = (from x in Funs.DB.WBS_UnitWork
where x.ProjectId == projectid
where x.ProjectId == projectid && (x.SuperUnitWork == null || x.SuperUnitWork == "0")
select x).Count();
return result;
}
@@ -1,5 +1,4 @@
using FineUIPro;
using Microsoft.SqlServer.Dts.Runtime;
using NPOI.SS.Formula.Functions;
using System;
using System.Collections;
@@ -1,5 +1,4 @@
using FineUIPro;
using Microsoft.SqlServer.Dts.Runtime;
using Model;
using System;
using System.Collections;
@@ -1,5 +1,4 @@
using FineUIPro;
using Microsoft.SqlServer.Dts.Runtime;
using System;
using System.Collections;
using System.Collections.Generic;
@@ -1,5 +1,4 @@
using FineUIPro;
using Microsoft.SqlServer.Dts.Runtime;
using System;
using System.Collections;
using System.Collections.Generic;
@@ -42,6 +42,28 @@ namespace BLL
}
}
public static void StartUpdateSitePerson()
{
//var getSynchroSet = Funs.DB.RealName_SynchroSet.FirstOrDefault();
//if (getSynchroSet != null && getSynchroSet.Intervaltime.HasValue)
//{
// adTimeJ = getSynchroSet.Intervaltime.Value;
//}
if (messageTimer != null)
{
messageTimer.Stop();
messageTimer.Dispose();
messageTimer = null;
}
messageTimer = new Timer
{
AutoReset = true
};
messageTimer.Elapsed += new ElapsedEventHandler(UpdateSitePerson);
messageTimer.Interval = 1000 * 60 * 60 * 24;// 60分钟 60000 * adTimeJ;
messageTimer.Start();
}
/// <summary>
/// 流程确认 定时执行 系统启动5分钟
/// </summary>
@@ -75,6 +97,49 @@ namespace BLL
ErrLogInfo.WriteLog(ex, "数据接口定时器", "RealNameMonitorService.AdUserInProcess");
}
}
/// <summary>
/// 流程确认 定时执行 系统启动5分钟
/// </summary>
/// <param name="sender">Timer组件</param>
/// <param name="e">事件参数</param>
private static void UpdateSitePerson(object sender, ElapsedEventArgs e)
{
try
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var persons = from x in db.SitePerson_Person
join y in db.Base_Project on x.ProjectId equals y.ProjectId
join z in db.RealName_Project on y.JTProjectCode equals z.ProCode
join p in db.Project_ProjectUnit on new { x.UnitId, x.ProjectId } equals new { p.UnitId, p.ProjectId }
join v in db.ProjectData_TeamGroup on x.TeamGroupId equals v.TeamGroupId
join w in db.Base_WorkPost on x.WorkPostId equals w.WorkPostId
where z.JTproCode != null && x.IsCardNoOK == true && v.TeamId.HasValue && !x.OutTime.HasValue
&& p.IsSynchro == true
select x;
var personInOutNows = from x in db.RealName_PersonInOutNow select x;
foreach (var person in persons)
{
var personInOutNow = personInOutNows.OrderByDescending(x => x.ChangeTime).FirstOrDefault();
if (personInOutNow == null)
{
person.OutTime = DateTime.Now;
}
else if (personInOutNow.ChangeTime < DateTime.Now.AddDays(-3))
{
person.OutTime = personInOutNow.ChangeTime;
}
}
db.SubmitChanges();
}
}
catch (Exception ex)
{
StartMonitor();
ErrLogInfo.WriteLog(ex, "数据接口定时器", "RealNameMonitorService.AdUserInProcess");
}
}
#endregion
#region 5-
@@ -159,7 +224,7 @@ namespace BLL
}
if (delCount >= 10000)
{
{
return;
}
}
@@ -185,7 +250,7 @@ namespace BLL
/// </summary>
public static void StartMonitorDeletePushLog()
{
int adTimeJ = 60 * 4;
int adTimeJ = 60 * 4;
if (messageTimer1 != null)
{
messageTimer1.Stop();