提交代码
This commit is contained in:
@@ -61,7 +61,7 @@ namespace BLL
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.PersonItem person = new Model.PersonItem();
|
||||
var getProjectPerson = db.SitePerson_Person.FirstOrDefault(x => x.SitePersonId == sitePersonId || (x.ProjectId == projectId && x.ProjectId.Length > 1 && x.IdentityCard == idcard));
|
||||
var getProjectPerson = db.SitePerson_Person.FirstOrDefault(x => x.SitePersonId == sitePersonId || (x.ProjectId == projectId && x.ProjectId.Length > 1 && x.IdentityCard == idcard));
|
||||
if (getProjectPerson != null)
|
||||
{
|
||||
person.SitePersonId = getProjectPerson.SitePersonId;
|
||||
@@ -133,7 +133,8 @@ namespace BLL
|
||||
person.AttachUrl2 = APIUpLoadFileService.getFileUrl(getProjectPerson.PersonId + "#2", null);
|
||||
person.AttachUrl3 = APIUpLoadFileService.getFileUrl(getProjectPerson.PersonId + "#3", null);
|
||||
person.AttachUrl4 = getAttachUrl4(getProjectPerson.PersonId);
|
||||
person.AttachUrl5 = APIUpLoadFileService.getFileUrl(getProjectPerson.PersonId + "#5", null);
|
||||
person.AttachUrl5 = APIUpLoadFileService.getFileUrl(getProjectPerson.PersonId + "#5", null);
|
||||
person.AttachUrl6 = APIUpLoadFileService.getFileUrl(getProjectPerson.PersonId + "#6", null);
|
||||
}
|
||||
var getPerson = db.Person_Persons.FirstOrDefault(x => x.IdentityCard == idcard && idcard.Length > 1);
|
||||
if (getPerson != null)
|
||||
@@ -443,11 +444,11 @@ namespace BLL
|
||||
/// <param name="workPostIds">培训岗位ID</param>
|
||||
/// <param name="trainTypeId">培训类型ID</param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.PersonItem> getTrainingPersonListByTrainTypeId(string projectId, string unitIds, string workPostIds, string trainTypeId,string name)
|
||||
public static List<Model.PersonItem> getTrainingPersonListByTrainTypeId(string projectId, string unitIds, string workPostIds, string trainTypeId, string name)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
|
||||
|
||||
var getPersons = from x in db.View_SitePerson_Person
|
||||
where x.ProjectId == projectId && x.States == Const.ProjectPersonStates_1
|
||||
select new Model.PersonItem
|
||||
@@ -583,7 +584,7 @@ namespace BLL
|
||||
UserId = newPerson.PersonId,
|
||||
MenuId = Const.PersonListMenuId,
|
||||
OperationName = "APP修改人员",
|
||||
OperationLog = "修改人员"+newPerson.PersonName,
|
||||
OperationLog = "修改人员" + newPerson.PersonName,
|
||||
DataId = newPerson.PersonId,
|
||||
ProjectId = person.ProjectId,
|
||||
};
|
||||
@@ -598,7 +599,7 @@ namespace BLL
|
||||
|
||||
if (!string.IsNullOrEmpty(newPerson.PersonId))
|
||||
{
|
||||
SaveMeetUrl(newPerson.PersonId, Const.PersonListMenuId, person.AttachUrl1, person.AttachUrl2, person.AttachUrl3, person.AttachUrl4, person.AttachUrl5);
|
||||
SaveMeetUrl(newPerson.PersonId, Const.PersonListMenuId, person.AttachUrl1, person.AttachUrl2, person.AttachUrl3, person.AttachUrl4, person.AttachUrl5, person.AttachUrl6);
|
||||
}
|
||||
|
||||
if (person.States == Const.ProjectPersonStates_0 && !string.IsNullOrEmpty(newProjectPerson.AuditorId))
|
||||
@@ -619,7 +620,7 @@ namespace BLL
|
||||
/// <summary>
|
||||
/// 人员附件保存方法
|
||||
/// </summary>
|
||||
public static void SaveMeetUrl(string personId, string menuId, string url1, string url2, string url3, string url4, string url5)
|
||||
public static void SaveMeetUrl(string personId, string menuId, string url1, string url2, string url3, string url4, string url5, string url6)
|
||||
{
|
||||
Model.ToDoItem toDoItem = new Model.ToDoItem
|
||||
{
|
||||
@@ -659,6 +660,13 @@ namespace BLL
|
||||
{
|
||||
APIUpLoadFileService.SaveAttachUrl(toDoItem);
|
||||
}
|
||||
|
||||
toDoItem.DataId = personId + "#6";
|
||||
toDoItem.UrlStr = url6;
|
||||
if (!string.IsNullOrEmpty(url6))
|
||||
{
|
||||
APIUpLoadFileService.SaveAttachUrl(toDoItem);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -755,7 +763,7 @@ namespace BLL
|
||||
var getPerson = db.Person_Persons.FirstOrDefault(x => x.IdentityCard == person.IdentityCard || x.PersonId == person.PersonId);
|
||||
if (getPerson == null)
|
||||
{
|
||||
var getSitePerson = db.SitePerson_Person.FirstOrDefault(x => x.SitePersonId ==person.PersonId);
|
||||
var getSitePerson = db.SitePerson_Person.FirstOrDefault(x => x.SitePersonId == person.PersonId);
|
||||
if (getSitePerson != null)
|
||||
{
|
||||
getPerson = db.Person_Persons.FirstOrDefault(x => x.IdentityCard == getSitePerson.IdentityCard || x.PersonId == getSitePerson.PersonId);
|
||||
@@ -778,7 +786,7 @@ namespace BLL
|
||||
getPerson.IDCardUrl = person.AttachUrl1;
|
||||
}
|
||||
db.SubmitChanges();
|
||||
SaveMeetUrl(getPerson.PersonId, Const.PersonListMenuId, person.AttachUrl1, person.AttachUrl2, person.AttachUrl3, person.AttachUrl4, person.AttachUrl5);
|
||||
SaveMeetUrl(getPerson.PersonId, Const.PersonListMenuId, person.AttachUrl1, person.AttachUrl2, person.AttachUrl3, person.AttachUrl4, person.AttachUrl5, person.AttachUrl6);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -463,6 +463,7 @@
|
||||
<Compile Include="HSSE\Environmental\EnvironmentalEmergencyPlanService.cs" />
|
||||
<Compile Include="HSSE\Environmental\EnvironmentalMonitoringService.cs" />
|
||||
<Compile Include="HSSE\Environmental\UnexpectedEnvironmentalService.cs" />
|
||||
<Compile Include="HSSE\Hazard\ConstructionRiskListService.cs" />
|
||||
<Compile Include="HSSE\Hazard\Hazard_EnvironmentalRiskItemService.cs" />
|
||||
<Compile Include="HSSE\Hazard\Hazard_EnvironmentalRiskListService.cs" />
|
||||
<Compile Include="HSSE\Hazard\Hazard_HazardListService.cs" />
|
||||
|
||||
@@ -2194,6 +2194,10 @@ namespace BLL
|
||||
/// </summary>
|
||||
public const string ProjectCheckHolidayMenuId = "0D23A707-ADA0-4C2B-9665-611134243529";
|
||||
/// <summary>
|
||||
/// 施工作业风险
|
||||
/// </summary>
|
||||
public const string ConstructionRiskMenuId = "F531D523-35BC-4D13-88D3-CB2554C4185C";
|
||||
/// <summary>
|
||||
/// 危险因素统计分析
|
||||
/// </summary>
|
||||
public const string CheckAnalysisMenuId = "14C42C8E-8D3D-4D30-AA56-4F96828610AD";
|
||||
@@ -3483,6 +3487,10 @@ namespace BLL
|
||||
/// 焊口二次设计信息模板文件原始虚拟路径
|
||||
/// </summary>
|
||||
public const string JotTwoDesignTemplateUrl = "File\\Excel\\DataOut\\焊口二次设计信息.xlsx";
|
||||
/// <summary>
|
||||
/// 施工作业风险导入模板
|
||||
/// </summary>
|
||||
public const string ConstructionRiskTemplateUrl = "File\\Excel\\DataIn\\施工作业风险导入模板.xls";
|
||||
#endregion
|
||||
|
||||
#region 初始化上传路径
|
||||
|
||||
@@ -1498,8 +1498,14 @@ namespace BLL
|
||||
return splitLists;
|
||||
}
|
||||
|
||||
public static int GetWeekOfYear(DateTime dtWeek)
|
||||
{
|
||||
System.Globalization.GregorianCalendar gc = new System.Globalization.GregorianCalendar();
|
||||
int weekOfYear = gc.GetWeekOfYear(dtWeek, System.Globalization.CalendarWeekRule.FirstDay, DayOfWeek.Monday);
|
||||
return weekOfYear;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,167 @@
|
||||
using Org.BouncyCastle.Bcpg.Sig;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class ConstructionRiskListService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 要求主键获取危险清单信息
|
||||
/// </summary>
|
||||
/// <param name="hazardListCode">主键</param>
|
||||
/// <returns></returns>
|
||||
public static Model.HSSE_ConstructionRisk GetConstructionRisk(string constructionRiskId)
|
||||
{
|
||||
return Funs.DB.HSSE_ConstructionRisk.FirstOrDefault(e => e.ConstructionRiskId == constructionRiskId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="hazardList"></param>
|
||||
public static void AddConstructionRisk(Model.HSSE_ConstructionRisk constructionRisk)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.HSSE_ConstructionRisk newconstructionRisk = new Model.HSSE_ConstructionRisk
|
||||
{
|
||||
ProjectId = constructionRisk.ProjectId,
|
||||
|
||||
ConstructionRiskId = constructionRisk.ConstructionRiskId,
|
||||
DateA = constructionRisk.DateA,
|
||||
DateZ = constructionRisk.DateZ,
|
||||
DateWeek = constructionRisk.DateWeek,
|
||||
ConstructionContent = constructionRisk.ConstructionContent,
|
||||
States = constructionRisk.States,
|
||||
RefLicense = constructionRisk.RefLicense,
|
||||
LicenseDes = constructionRisk.LicenseDes,
|
||||
WorkAreaId = constructionRisk.WorkAreaId,
|
||||
UnitId = constructionRisk.UnitId,
|
||||
RiskLevel = constructionRisk.RiskLevel
|
||||
};
|
||||
Funs.DB.HSSE_ConstructionRisk.InsertOnSubmit(newconstructionRisk);
|
||||
Funs.DB.SubmitChanges();
|
||||
|
||||
}
|
||||
|
||||
public static void AddConstructionRiskControl(Model.HSSE_ConstructionRiskControl constructionRiskControl)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.HSSE_ConstructionRiskControl newconstructionRisk = new Model.HSSE_ConstructionRiskControl
|
||||
{
|
||||
|
||||
ControlId = constructionRiskControl.ControlId,
|
||||
Measures = constructionRiskControl.Measures,
|
||||
CheckMan = constructionRiskControl.CheckMan,
|
||||
CheckResult = constructionRiskControl.CheckResult,
|
||||
Rectification = constructionRiskControl.Rectification,
|
||||
ShowIndex = constructionRiskControl.ShowIndex,
|
||||
ConstructionRiskId = constructionRiskControl.ConstructionRiskId
|
||||
};
|
||||
Funs.DB.HSSE_ConstructionRiskControl.InsertOnSubmit(newconstructionRisk);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
public static void UpdateConstructionRiskControl(Model.HSSE_ConstructionRiskControl constructionRiskControl)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.HSSE_ConstructionRiskControl newconstructionRisk = Funs.DB.HSSE_ConstructionRiskControl.FirstOrDefault(x => x.ControlId == constructionRiskControl.ControlId);
|
||||
|
||||
if (newconstructionRisk != null)
|
||||
{
|
||||
newconstructionRisk.ControlId = constructionRiskControl.ControlId;
|
||||
newconstructionRisk.Measures = constructionRiskControl.Measures;
|
||||
newconstructionRisk.CheckMan = constructionRiskControl.CheckMan;
|
||||
newconstructionRisk.CheckResult = constructionRiskControl.CheckResult;
|
||||
newconstructionRisk.Rectification = constructionRiskControl.Rectification;
|
||||
newconstructionRisk.ShowIndex = constructionRiskControl.ShowIndex;
|
||||
newconstructionRisk.ConstructionRiskId = constructionRiskControl.ConstructionRiskId;
|
||||
}
|
||||
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
public static void AddConstructionRiskControl(List<Model.HSSE_ConstructionRiskControl > constructionRisk,string constructionRiskId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
int i = 1;
|
||||
|
||||
var cons = Funs.DB.HSSE_ConstructionRiskControl.Where(x => x.ConstructionRiskId == constructionRiskId);
|
||||
if (cons.Count() > 0)
|
||||
{
|
||||
Funs.DB.HSSE_ConstructionRiskControl.DeleteAllOnSubmit(cons);
|
||||
}
|
||||
foreach (var item in constructionRisk)
|
||||
{
|
||||
Model.HSSE_ConstructionRiskControl newconstructionRisk = new Model.HSSE_ConstructionRiskControl
|
||||
{
|
||||
ControlId = item.ControlId,
|
||||
ConstructionRiskId = constructionRiskId,
|
||||
Measures = item.Measures,
|
||||
CheckResult = item.CheckResult,
|
||||
CheckMan = item.CheckMan,
|
||||
Rectification = item.Rectification,
|
||||
ShowIndex = i++,
|
||||
};
|
||||
Funs.DB.HSSE_ConstructionRiskControl.InsertOnSubmit(newconstructionRisk);
|
||||
}
|
||||
Funs.DB.SubmitChanges();
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="hazardList"></param>
|
||||
public static void UpdateConstructionRisk(Model.HSSE_ConstructionRisk hazardList)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.HSSE_ConstructionRisk newHazardList = db.HSSE_ConstructionRisk.FirstOrDefault(e => e.ConstructionRiskId == hazardList.ConstructionRiskId);
|
||||
if (newHazardList != null)
|
||||
{
|
||||
newHazardList.ProjectId = hazardList.ProjectId;
|
||||
newHazardList.DateA = hazardList.DateA;
|
||||
newHazardList.DateZ = hazardList.DateZ;
|
||||
newHazardList.DateWeek = hazardList.DateWeek;
|
||||
newHazardList.ConstructionContent = hazardList.ConstructionContent;
|
||||
newHazardList.States = hazardList.States;
|
||||
newHazardList.RefLicense = hazardList.RefLicense;
|
||||
newHazardList.LicenseDes = hazardList.LicenseDes;
|
||||
newHazardList.WorkAreaId = hazardList.WorkAreaId;
|
||||
newHazardList.UnitId = hazardList.UnitId;
|
||||
newHazardList.RiskLevel = hazardList.RiskLevel;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
else
|
||||
{
|
||||
AddConstructionRisk(hazardList);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="constructionRiskId"> </param>
|
||||
public static void DeleteConstructionRisk(string constructionRiskId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.HSSE_ConstructionRisk hazardList = db.HSSE_ConstructionRisk.FirstOrDefault(e => e.ConstructionRiskId == constructionRiskId);
|
||||
if (hazardList != null)
|
||||
{
|
||||
|
||||
var constructionRiskControls = db.HSSE_ConstructionRiskControl.Where(e => e.ConstructionRiskId == constructionRiskId);
|
||||
if (constructionRiskControls.Count() > 0)
|
||||
{
|
||||
db.HSSE_ConstructionRiskControl.DeleteAllOnSubmit(constructionRiskControls);
|
||||
}
|
||||
db.HSSE_ConstructionRisk.DeleteOnSubmit(hazardList);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user